diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-03-06 19:52:21 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-03-06 19:52:21 +0800 |
commit | 83790c2b83179b2170417e34f0fa55b75808a0dd (patch) | |
tree | 89caa3148cb61c39ad02fb585903924c514747d9 /libempathy/empathy-log-manager.c | |
parent | 164b812f079db09d1fb91b4ed6031ae72ae574e8 (diff) | |
download | gsoc2013-empathy-83790c2b83179b2170417e34f0fa55b75808a0dd.tar gsoc2013-empathy-83790c2b83179b2170417e34f0fa55b75808a0dd.tar.gz gsoc2013-empathy-83790c2b83179b2170417e34f0fa55b75808a0dd.tar.bz2 gsoc2013-empathy-83790c2b83179b2170417e34f0fa55b75808a0dd.tar.lz gsoc2013-empathy-83790c2b83179b2170417e34f0fa55b75808a0dd.tar.xz gsoc2013-empathy-83790c2b83179b2170417e34f0fa55b75808a0dd.tar.zst gsoc2013-empathy-83790c2b83179b2170417e34f0fa55b75808a0dd.zip |
Remove MessageObserveData as the TpChannel can be retrieved from an EmpathyTpChat.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=2597
Diffstat (limited to 'libempathy/empathy-log-manager.c')
-rw-r--r-- | libempathy/empathy-log-manager.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/libempathy/empathy-log-manager.c b/libempathy/empathy-log-manager.c index ce92965a9..0c57168ac 100644 --- a/libempathy/empathy-log-manager.c +++ b/libempathy/empathy-log-manager.c @@ -375,30 +375,20 @@ empathy_log_manager_get_date_readable (const gchar *date) return empathy_time_to_string_local (t, "%a %d %b %Y"); } -typedef struct -{ - EmpathyLogManager *log_manager; - TpChannel *channel; -} MessageObserveData; - -static void -message_observe_data_free (MessageObserveData *data) -{ - g_slice_free (MessageObserveData, data); -} - static void log_manager_chat_received_message_cb (EmpathyTpChat *tp_chat, EmpathyMessage *message, - MessageObserveData *data) + EmpathyLogManager *log_manager) { GError *error = NULL; TpHandleType handle_type; + TpChannel *channel; - tp_channel_get_handle (data->channel, &handle_type); + channel = empathy_tp_chat_get_channel (tp_chat); + tp_channel_get_handle (channel, &handle_type); - if (!empathy_log_manager_add_message (data->log_manager, - tp_channel_get_identifier (data->channel), + if (!empathy_log_manager_add_message (log_manager, + tp_channel_get_identifier (channel), handle_type == TP_HANDLE_TYPE_ROOM, message, &error)) { @@ -422,21 +412,12 @@ log_manager_dispatcher_observe_cb (EmpathyDispatcher *dispatcher, if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_TEXT) { EmpathyTpChat *tp_chat; - TpChannel *channel; - MessageObserveData *data; tp_chat = EMPATHY_TP_CHAT ( empathy_dispatch_operation_get_channel_wrapper (operation)); - channel = empathy_dispatch_operation_get_channel (operation); - - data = g_slice_new0 (MessageObserveData); - data->log_manager = log_manager; - data->channel = channel; - - g_signal_connect_data (tp_chat, "message-received", - G_CALLBACK (log_manager_chat_received_message_cb), data, - (GClosureNotify) message_observe_data_free, 0); + g_signal_connect (tp_chat, "message-received", + G_CALLBACK (log_manager_chat_received_message_cb), log_manager); } } |