[Telepathy-commits] [telepathy-gabble/master] gabble-media-channel: don't move peer to remote-pending if he's already in members (Close fd.o #15791)

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Aug 19 10:52:18 PDT 2008


20080512110910-7fe3f-11a05052b4bc7b4410338a6c3991db68a2b5c054.gz
---
 src/gabble-media-channel.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/gabble-media-channel.c b/src/gabble-media-channel.c
index 8273d74..97d48a4 100644
--- a/src/gabble-media-channel.c
+++ b/src/gabble-media-channel.c
@@ -1299,6 +1299,9 @@ session_state_changed_cb (GabbleMediaSession *session,
   JingleSessionState state;
   TpHandle peer;
   TpIntSet *set;
+  GArray *members;
+  gboolean peer_in_members = FALSE;
+  guint i;
 
   g_object_get (session,
                 "state", &state,
@@ -1309,8 +1312,16 @@ session_state_changed_cb (GabbleMediaSession *session,
 
   tp_intset_add (set, peer);
 
+  /* Is the peer already in members ? */
+  tp_group_mixin_get_members ((GObject *) channel, &members, NULL);
+  for (i = 0; i < members->len && !peer_in_members; i++)
+    {
+      peer_in_members = (g_array_index (members, TpHandle, i) == peer);
+    }
+  g_array_free (members, TRUE);
+
   if (state >= JS_STATE_PENDING_INITIATE_SENT &&
-      state < JS_STATE_ACTIVE)
+      state < JS_STATE_ACTIVE && !peer_in_members)
     {
       /* The first time we send anything to the other user, they materialise
        * in remote-pending if necessary */
-- 
1.5.6.3




More information about the Telepathy-commits mailing list