]> git.0d.be Git - empathy.git/commitdiff
chat-manager: pass user action time of DBus to show the closed tab
authorJonny Lamb <jonnylamb@gnome.org>
Wed, 18 May 2011 13:50:34 +0000 (14:50 +0100)
committerJonny Lamb <jonnylamb@gnome.org>
Wed, 18 May 2011 14:15:10 +0000 (15:15 +0100)
This was making undo closing tabs in the background, aww.

Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
extensions/Chat_Manager.xml
src/empathy-chat-manager.c
src/empathy-chat-manager.h
src/empathy-chat-window.c

index 7a6fef8a384e34dfaca49a2fef4ee93a38af712b..15ea95122b2c6f5e708d14372d8b911da86405c4 100644 (file)
@@ -20,6 +20,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</
   <interface name="org.gnome.Empathy.ChatManager">
 
     <method name="UndoClosedChat" tp:name-for-bindings="Undo_Closed_Chat">
+      <arg direction="in" type="x" name="User_Time">
+        <tp:docstring>
+          The user action time for the event.
+        </tp:docstring>
+      </arg>
       <tp:docstring>
         Ask the chat manager to undo closing a tab. If there is no tab
         to be opened then return successfully.
index bf870c8ccb6ade4e29e38b494afba472aece0297..d8e573320160a59b14b0fa83af093e9d9fb5ba3b 100644 (file)
@@ -24,6 +24,8 @@
 #include <libempathy/empathy-request-util.h>
 #include <libempathy/empathy-utils.h>
 
+#include <libempathy-gtk/empathy-ui-utils.h>
+
 #include "empathy-chat-window.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
@@ -508,7 +510,8 @@ empathy_chat_manager_closed_chat (EmpathyChatManager *self,
 }
 
 void
-empathy_chat_manager_undo_closed_chat (EmpathyChatManager *self)
+empathy_chat_manager_undo_closed_chat (EmpathyChatManager *self,
+    gint64 timestamp)
 {
   EmpathyChatManagerPriv *priv = GET_PRIV (self);
   ChatData *data;
@@ -522,11 +525,9 @@ empathy_chat_manager_undo_closed_chat (EmpathyChatManager *self)
       data->room ? "room" : "contact", data->id);
 
   if (data->room)
-    empathy_join_muc (data->account, data->id,
-        TP_USER_ACTION_TIME_NOT_USER_ACTION);
+    empathy_join_muc (data->account, data->id, timestamp);
   else
-    empathy_chat_with_contact_id (data->account, data->id,
-        TP_USER_ACTION_TIME_NOT_USER_ACTION);
+    empathy_chat_with_contact_id (data->account, data->id, timestamp);
 
   g_signal_emit (self, signals[CLOSED_CHATS_CHANGED], 0,
       g_queue_get_length (priv->closed_queue));
@@ -544,9 +545,11 @@ empathy_chat_manager_get_num_closed_chats (EmpathyChatManager *self)
 
 static void
 empathy_chat_manager_dbus_undo_closed_chat (EmpSvcChatManager *manager,
+    gint64 timestamp,
     DBusGMethodInvocation *context)
 {
-  empathy_chat_manager_undo_closed_chat ((EmpathyChatManager *) manager);
+  empathy_chat_manager_undo_closed_chat ((EmpathyChatManager *) manager,
+      timestamp);
 
   emp_svc_chat_manager_return_from_undo_closed_chat (context);
 }
@@ -581,7 +584,8 @@ empathy_chat_manager_call_undo_closed_chat (void)
 
   tp_proxy_add_interface_by_id (proxy, EMP_IFACE_QUARK_CHAT_MANAGER);
 
-  emp_cli_chat_manager_call_undo_closed_chat (proxy, -1, NULL, NULL, NULL, NULL);
+  emp_cli_chat_manager_call_undo_closed_chat (proxy, -1, empathy_get_current_action_time (),
+      NULL, NULL, NULL, NULL);
 
   g_object_unref (proxy);
   g_object_unref (dbus_daemon);
index 88632b4dd55ad7bc9907eab7e7793b46a95c5795..7dfd53480a04460ad4b643d7a00a2b4a9e03c8ad 100644 (file)
@@ -62,7 +62,8 @@ EmpathyChatManager *empathy_chat_manager_dup_singleton (void);
 
 void empathy_chat_manager_closed_chat (EmpathyChatManager *self,
     EmpathyChat *chat);
-void empathy_chat_manager_undo_closed_chat (EmpathyChatManager *self);
+void empathy_chat_manager_undo_closed_chat (EmpathyChatManager *self,
+    gint64 timestamp);
 guint empathy_chat_manager_get_num_closed_chats (EmpathyChatManager *self);
 
 void empathy_chat_manager_call_undo_closed_chat (void);
index d8a75cb0cf0b9046ab82b29eb86ca8d0fbc56e89..e987bf7daa28812af2310e69f28c15b2078fb735 100644 (file)
@@ -1191,7 +1191,8 @@ chat_window_tabs_undo_close_tab_activate_cb (GtkAction         *action,
                                             EmpathyChatWindow *window)
 {
        EmpathyChatWindowPriv *priv = GET_PRIV (window);
-       empathy_chat_manager_undo_closed_chat (priv->chat_manager);
+       empathy_chat_manager_undo_closed_chat (priv->chat_manager,
+                                              empathy_get_current_action_time ());
 }
 
 static void