diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-11 21:53:50 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-05-25 15:22:41 +0800 |
commit | 0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c (patch) | |
tree | 22d694d8dce6c66151362c1301e3fa9a6291ff9a /src | |
parent | 4e39c2c5adac55793143c110159fa40cc51f324c (diff) | |
download | gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.gz gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.bz2 gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.lz gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.xz gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.zst gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.zip |
EmpathyTpChat: inherit from TpTextChannel (#650554)
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-chat-manager.c | 15 | ||||
-rw-r--r-- | src/empathy-event-manager.c | 5 | ||||
-rw-r--r-- | src/empathy-invite-participant-dialog.c | 5 |
3 files changed, 9 insertions, 16 deletions
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c index 8bdc97e90..666147de6 100644 --- a/src/empathy-chat-manager.c +++ b/src/empathy-chat-manager.c @@ -192,8 +192,6 @@ process_tp_chat (EmpathyChatManager *self, * channel has been approved. */ empathy_tp_chat_join (tp_chat); } - - g_object_unref (tp_chat); } typedef struct @@ -264,22 +262,19 @@ handle_channels (TpSimpleHandler *handler, for (l = channels; l != NULL; l = g_list_next (l)) { - TpChannel *channel = l->data; - EmpathyTpChat *tp_chat; + EmpathyTpChat *tp_chat = l->data; - if (tp_proxy_get_invalidated (channel) != NULL) + if (tp_proxy_get_invalidated (tp_chat) != NULL) continue; - if (!TP_IS_TEXT_CHANNEL (channel)) + if (!EMPATHY_IS_TP_CHAT (tp_chat)) { DEBUG ("Channel %s doesn't implement Messages; can't handle it", - tp_proxy_get_object_path (channel)); + tp_proxy_get_object_path (tp_chat)); continue; } - DEBUG ("Now handling channel %s", tp_proxy_get_object_path (channel)); - - tp_chat = empathy_tp_chat_new (account, channel); + DEBUG ("Now handling channel %s", tp_proxy_get_object_path (tp_chat)); if (empathy_tp_chat_is_ready (tp_chat)) { diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 770b22b43..baa06dc27 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -928,10 +928,9 @@ approve_channels (TpSimpleApprover *approver, if (TP_IS_TEXT_CHANNEL (channel)) { - EmpathyTpChat *tp_chat; + EmpathyTpChat *tp_chat = EMPATHY_TP_CHAT (channel); - tp_chat = empathy_tp_chat_new (account, channel); - approval->handler_instance = G_OBJECT (tp_chat); + approval->handler_instance = g_object_ref (tp_chat); if (tp_proxy_has_interface (channel, TP_IFACE_CHANNEL_INTERFACE_GROUP)) { diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c index a7b1a3600..c40bb9458 100644 --- a/src/empathy-invite-participant-dialog.c +++ b/src/empathy-invite-participant-dialog.c @@ -168,7 +168,6 @@ filter_func (GtkTreeModel *model, gboolean is_online; GList *members, *l; gboolean display = FALSE; - TpChannel *channel; gtk_tree_model_get (model, iter, EMPATHY_INDIVIDUAL_STORE_COL_INDIVIDUAL, &individual, @@ -190,7 +189,6 @@ filter_func (GtkTreeModel *model, self->priv->tp_chat)); display = TRUE; - channel = empathy_tp_chat_get_channel (self->priv->tp_chat); for (l = members; l != NULL; l = g_list_next (l)) { @@ -198,7 +196,8 @@ filter_func (GtkTreeModel *model, TpHandle handle; /* Try to get the non-channel specific handle. */ - handle = tp_channel_group_get_handle_owner (channel, + handle = tp_channel_group_get_handle_owner ( + TP_CHANNEL (self->priv->tp_chat), empathy_contact_get_handle (member)); if (handle == 0) handle = empathy_contact_get_handle (member); |