]> git.0d.be Git - empathy.git/commitdiff
Join room where we have been invited when handling the channel rather than we we...
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 18 May 2010 15:20:23 +0000 (17:20 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 7 Jun 2010 11:00:14 +0000 (13:00 +0200)
src/empathy-event-manager.c
src/empathy.c

index 08f4909667b48761312f3d5c907bbf4a6339d38c..2f269f573b4a59d70fdc26c633e0c0e5ff33694c 100644 (file)
@@ -536,9 +536,6 @@ invite_dialog_response_cb (GtkDialog *dialog,
                            EventManagerApproval *approval)
 {
   EmpathyTpChat *tp_chat;
-  TpChannel *channel;
-  TpHandle self_handle;
-  GArray *members;
   gint64 timestamp;
 
   gtk_widget_destroy (GTK_WIDGET (approval->dialog));
@@ -559,15 +556,7 @@ invite_dialog_response_cb (GtkDialog *dialog,
 
   DEBUG ("Muc invitation accepted");
 
-  /* join the room */
-  channel = empathy_tp_chat_get_channel (tp_chat);
-
-  self_handle = tp_channel_group_get_self_handle (channel);
-  members = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1);
-  g_array_append_val (members, self_handle);
-
-  tp_cli_channel_interface_group_call_add_members (channel, -1, members,
-      "", NULL, NULL, NULL, NULL);
+  /* We'll join the room when handling the channel */
 
   timestamp = gtk_get_current_event_time ();
   if (timestamp == GDK_CURRENT_TIME)
@@ -576,8 +565,6 @@ invite_dialog_response_cb (GtkDialog *dialog,
   empathy_dispatch_operation_set_user_action_time (approval->operation,
     timestamp);
   empathy_dispatch_operation_approve (approval->operation);
-
-  g_array_free (members, TRUE);
 }
 
 static void
index 5dcf035e3d26fd2f710de3ed646139a30146eac4..9d59bba79ec10eb1d78199b764b91f076205316c 100644 (file)
@@ -136,6 +136,13 @@ dispatch_cb (EmpathyDispatcher *dispatcher,
       empathy_chat_window_present_chat (chat,
           empathy_dispatch_operation_get_user_action_time (operation));
 
+      if (empathy_tp_chat_is_invited (tp_chat))
+        {
+          /* We have been invited to the room. Add ourself as member as this
+           * channel has been approved. */
+          empathy_tp_chat_join (tp_chat);
+        }
+
       empathy_dispatch_operation_claim (operation);
     }
   else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)