[telepathy-gabble/master] Don't send a content-modify message if the content hasn't been sent yet.

Mike Ruprecht mike.ruprecht at collabora.co.uk
Mon Jan 18 19:14:13 PST 2010


This fixes a crash if you SetSending before session-initiate is sent.
---
 src/jingle-content.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/jingle-content.c b/src/jingle-content.c
index 26c9dc5..e3e306c 100644
--- a/src/jingle-content.c
+++ b/src/jingle-content.c
@@ -978,10 +978,13 @@ gabble_jingle_content_change_direction (GabbleJingleContent *c,
       return FALSE;
     }
 
-  msg = gabble_jingle_session_new_message (c->session,
-      JINGLE_ACTION_CONTENT_MODIFY, &sess_node);
-  gabble_jingle_content_produce_node (c, sess_node, FALSE, FALSE, NULL);
-  gabble_jingle_session_send (c->session, msg, NULL, NULL);
+  if (priv->state >= JINGLE_CONTENT_STATE_SENT)
+    {
+      msg = gabble_jingle_session_new_message (c->session,
+          JINGLE_ACTION_CONTENT_MODIFY, &sess_node);
+      gabble_jingle_content_produce_node (c, sess_node, FALSE, FALSE, NULL);
+      gabble_jingle_session_send (c->session, msg, NULL, NULL);
+    }
 
   /* FIXME: actually check whether remote end accepts our content-modify */
   return TRUE;
-- 
1.5.6.5




More information about the telepathy-commits mailing list