[Telepathy-commits] [telepathy-gabble/master] activity_membership_change: associate buddies with the activity when adding them to the view

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Sep 26 10:02:25 PDT 2008


20080630130456-7fe3f-38f430de5d10cb820545f47551f079f04761dff3.gz
---
 src/conn-olpc.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 701e83e..d298816 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -3238,11 +3238,14 @@ activity_added (GabbleConnection *conn,
   add_activities_to_view_from_node (conn, view, added);
 }
 
+/* if activity is not zero, buddies are associated with the passed
+ * activity room */
 static gboolean
 add_buddies_to_view_from_node (GabbleConnection *conn,
                                GabbleOlpcView *view,
                                LmMessageNode *node,
-                               const gchar *node_name)
+                               const gchar *node_name,
+                               TpHandle activity)
 {
   GArray *buddies;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
@@ -3268,7 +3271,7 @@ add_buddies_to_view_from_node (GabbleConnection *conn,
       return TRUE;
     }
 
-  gabble_olpc_view_add_buddies (view, buddies, buddies_properties, 0);
+  gabble_olpc_view_add_buddies (view, buddies, buddies_properties, activity);
 
   for (i = 0; i < buddies->len; i++)
     {
@@ -3312,7 +3315,7 @@ buddy_added (GabbleConnection *conn,
       return;
     }
 
-  add_buddies_to_view_from_node (conn, view, added, "buddy");
+  add_buddies_to_view_from_node (conn, view, added, "buddy", 0);
 }
 
 static gboolean
@@ -3483,7 +3486,7 @@ activity_membership_change (GabbleConnection *conn,
     }
 
   /* joined buddies */
-  add_buddies_to_view_from_node (conn, view, activity_node, "joined");
+  add_buddies_to_view_from_node (conn, view, activity_node, "joined", handle);
 
   /* TODO: left and closed */
 
@@ -3677,7 +3680,7 @@ buddy_query_result_cb (GabbleConnection *conn,
   if (view_node == NULL)
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
 
-  add_buddies_to_view_from_node (conn, view, view_node, "buddy");
+  add_buddies_to_view_from_node (conn, view, view_node, "buddy", 0);
 
   return LM_HANDLER_RESULT_REMOVE_MESSAGE;
 }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list