[empathy] Join room where we have been invited when handling the channel rather than we we approve it



commit 7b4c1e7640abf3abc27ce9d3f7b066b14557840e
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue May 18 17:20:23 2010 +0200

    Join room where we have been invited when handling the channel rather than we we approve it

 src/empathy-event-manager.c |   15 +--------------
 src/empathy.c               |    7 +++++++
 2 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 08f4909..2f269f5 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -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
diff --git a/src/empathy.c b/src/empathy.c
index 5dcf035..9d59bba 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]