[meego-commits] 9454: Changes to MeeGo:1.1:Core:Update:Testing/telepathy-gabble
Rob Bradford
no_reply at build.meego.com
Fri Nov 12 13:30:51 UTC 2010
Hi,
I have made the following changes to telepathy-gabble in project MeeGo:1.1:Core:Update:Testing. Please review and accept ASAP.
Thank You,
Rob Bradford
[This message was auto-generated]
---
Request #9454:
submit: home:rbradford:branches:MeeGo:1.1:Core:Update:Testing/telepathy-gabble(r2)(cleanup) -> MeeGo:1.1:Core:Update:Testing/telepathy-gabble
Message:
None
State: new 2010-11-12T05:30:50 rbradford
Comment: None
changes files:
--------------
--- telepathy-gabble.changes
+++ telepathy-gabble.changes
@@ -0,0 +1,3 @@
+* Mon Nov 08 2010 Rob Bradford <rob at linux.intel.com> - 0.9.15
+- Include patch to workaround server mail notification issues (BMC#3879)
+
new:
----
0001-Mail-status-polling-to-workaround-server-laziness.patch
spec files:
-----------
--- telepathy-gabble.spec
+++ telepathy-gabble.spec
@@ -1,6 +1,6 @@
#
# Do not Edit! Generated by:
-# spectacle version 0.18
+# spectacle version 0.16
#
# >> macros
# << macros
@@ -14,6 +14,7 @@
URL: http://telepathy.freedesktop.org/wiki/
Source0: http://telepathy.freedesktop.org/releases/telepathy-gabble/%{name}-%{version}.tar.gz
Source100: telepathy-gabble.yaml
+Patch0: 0001-Mail-status-polling-to-workaround-server-laziness.patch
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(nice) >= 0.0.11
BuildRequires: pkgconfig(uuid)
@@ -28,7 +29,6 @@
BuildRequires: pkgconfig(gnutls)
BuildRequires: python
-
%description
A Jabber/XMPP connection manager, that handles single and multi-user
chats and voice calls.
@@ -39,6 +39,8 @@
%prep
%setup -q -n %{name}-%{version}
+# 0001-Mail-status-polling-to-workaround-server-laziness.patch
+%patch0 -p1
# >> setup
# << setup
other changes:
--------------
++++++ 0001-Mail-status-polling-to-workaround-server-laziness.patch (new)
--- 0001-Mail-status-polling-to-workaround-server-laziness.patch
+++ 0001-Mail-status-polling-to-workaround-server-laziness.patch
+From 85b0cc96eb5b7082d48fc569f5b7e502316b57fe Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne at collabora.co.uk>
+Date: Tue, 5 Oct 2010 19:28:52 -0400
+Subject: [PATCH] Mail status polling to workaround server laziness
+
+The Google server stops pushing <new-mail> updates for the period of
+POLL_DURATION seconds. To ensure that MailNotification remains accurate,
+we manually update every POLL_DELAY seconds the mail information.
+---
+ src/conn-mail-notif.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 47 insertions(+), 0 deletions(-)
+
+diff --git a/src/conn-mail-notif.c b/src/conn-mail-notif.c
+index 5373454..9f209a4 100644
+--- a/src/conn-mail-notif.c
++++ b/src/conn-mail-notif.c
+@@ -45,6 +45,12 @@
+ #include "namespaces.h"
+ #include "util.h"
+
++/* The Google server stops pushing <new-mail> updates for the periode of
++ * POLL_DURATION seconds. To ensure that MailNotification remains accurate,
++ * we manually update every POLL_DELAY second the mail information.
++ */
++#define POLL_DELAY 5
++#define POLL_DURATION 60
+
+ enum
+ {
+@@ -62,6 +68,8 @@ struct _GabbleConnectionMailNotificationPrivate
+ GHashTable *unread_mails;
+ guint unread_count;
+ guint new_mail_handler_id;
++ guint poll_timeout_id;
++ guint poll_count;
+ GList *inbox_url_requests; /* list of DBusGMethodInvocation */
+ };
+
+@@ -641,6 +649,33 @@ update_unread_mails (GabbleConnection *conn)
+ g_object_unref (query);
+ }
+
++static gboolean
++poll_unread_mails_cb (gpointer user_data)
++{
++ GabbleConnection *conn = GABBLE_CONNECTION (user_data);
++ GabbleConnectionMailNotificationPrivate *priv = conn->mail_priv;
++
++ if (priv->poll_count * POLL_DELAY >= POLL_DURATION)
++ {
++ DEBUG ("Stop polling mail after %i seconds", priv->poll_count * POLL_DELAY);
++ priv->poll_timeout_id = 0;
++ priv->poll_count = 0;
++ return FALSE;
++ }
++
++ priv->poll_count++;
++
++ /* When no subscriber, keep counting time, but don't actually update the
++ * data since nobody would care about it */
++ if (g_hash_table_size (priv->subscribers) > 0)
++ {
++ update_unread_mails (conn);
++ DEBUG ("Polling mail since %i seconds", priv->poll_count * POLL_DELAY);
++ }
++
++ return TRUE;
++}
++
+
+ static gboolean
+ new_mail_handler (WockyPorter *porter,
+@@ -653,6 +688,15 @@ new_mail_handler (WockyPorter *porter,
+ {
+ DEBUG ("Got Google <new-mail> notification");
+ update_unread_mails (conn);
++
++ conn->mail_priv->poll_count = 0;
++ if (conn->mail_priv->poll_timeout_id == 0)
++ {
++ DEBUG ("Start polling mail for next %i seconds", POLL_DURATION);
++ conn->mail_priv->poll_timeout_id = g_timeout_add_seconds (
++ POLL_DELAY,
++ (GSourceFunc) poll_unread_mails_cb, conn);
++ }
+ }
+
+ return TRUE;
+@@ -747,6 +791,9 @@ conn_mail_notif_dispose (GabbleConnection *conn)
+ priv->new_mail_handler_id = 0;
+ }
+
++ if (priv->poll_timeout_id != 0)
++ g_source_remove (priv->poll_timeout_id);
++
+ g_slice_free (GabbleConnectionMailNotificationPrivate, priv);
+ conn->mail_priv = NULL;
+ }
+--
+1.7.0.3
+
++++++ telepathy-gabble.yaml
--- telepathy-gabble.yaml
+++ telepathy-gabble.yaml
@@ -24,6 +24,8 @@
- libsoup-2.4
- libidn
- gnutls
+Patches:
+ - 0001-Mail-status-polling-to-workaround-server-laziness.patch
PkgBR:
- python
Configure: reconfigure
More information about the MeeGo-commits
mailing list