From 7d8f163d8dcb540f611b3581389e2c15971e479f Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Wed, 10 Mar 2010 18:34:34 +0000 Subject: dispatcher: allow not caring about handle type when looking up RCCs Signed-off-by: Jonny Lamb --- libempathy/empathy-dispatcher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index caf697cb6..1edefe9bf 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -1808,7 +1808,7 @@ channel_class_matches (GValueArray *class, h_type = tp_asv_get_uint32 (fprops, TP_IFACE_CHANNEL ".TargetHandleType", &valid); - if (!valid || handle_type != h_type) + if (!valid || (handle_type != h_type && handle_type != TP_UNKNOWN_HANDLE_TYPE)) return FALSE; if (fixed_properties != NULL) @@ -1978,7 +1978,8 @@ setup_varargs (va_list var_args, * @dispatcher: an #EmpathyDispatcher * @connection: a #TpConnection * @channel_type: a string identifying the type of the channel to lookup - * @handle_type: the handle type for the channel + * @handle_type: the handle type for the channel, or %TP_UNKNOWN_HANDLE_TYPE + * if you don't care about the channel's target handle type * @first_property_name: %NULL, or the name of the first fixed property, * followed optionally by more names, followed by %NULL. * -- cgit v1.2.3 From 13a7c40c5aaf9b6ff9d75073775472f413959033 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Wed, 10 Mar 2010 18:41:08 +0000 Subject: tp-chat: when seeing if a chat can be upgraded, don't worry about handle type When you upgrade a gtalk 1-1 chat to a PMUC, it moves from [ChannelType=TEXT, TargetHandleType=CONTACT] to [ChannelType=TEXT, TargetHandleType=ROOM]. When you upgrade an MSN 1-1 chat to a multi-user chat in butterfly, it moves from [ChannelType=TEXT, TargetHandleType=CONTACT] to [ChannelType=TEXT, TargetHandleType=NONE]. Both of these cases have the 1-1 chat properties set as fixed properties in a class in their connection's RCC. They both also have the upgraded set of properties as above fixed, and o.fd.Tp.Channel.Interface.Conference(.DRAFT) in the appropriate Allowed_Properties array. Empathy used to look for this said channel interface in the allowed properties of a TargetHandleType=ROOM class. As butterfly uses TargetHandleType=NONE, this isn't so useful, so let's not care about the handle type to fit around both gtalk and MSN. Signed-off-by: Jonny Lamb --- libempathy/empathy-tp-chat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index cba102add..bba6733a6 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -1280,7 +1280,7 @@ tp_chat_constructor (GType type, list = empathy_dispatcher_find_requestable_channel_classes ( dispatcher, connection, tp_channel_get_channel_type (priv->channel), - TP_HANDLE_TYPE_ROOM, NULL); + TP_UNKNOWN_HANDLE_TYPE, NULL); for (ptr = list; ptr; ptr = ptr->next) { GValueArray *array = ptr->data; -- cgit v1.2.3 From 2a98cb3d4f7222097b4ec2f5343244d1b313eac1 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Wed, 10 Mar 2010 18:44:14 +0000 Subject: tp-chat: remove butterfly MSN HandleType=NONE workaround Newer versions of butterfly use the conference interface, so their 1-1 chats don't implement the group interface. This patch changes nothing there, but now when butterfly gives a channel with TargetHandleType=NONE, it is actually a MUC, so act like that. Thanks to the addition of the conference interface with this change, we can check for its presence to decide whether this is old-school or new-school butterfly. This commit and 13a7c40c together fix bug #612461. Signed-off-by: Jonny Lamb --- libempathy/empathy-tp-chat.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index bba6733a6..7877acb22 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -885,6 +885,14 @@ tp_chat_update_remote_contact (EmpathyTpChat *chat) return; } + /* This is an MSN chat, but it's the new style where 1-1 chats don't + * have the group interface. If it has the conference interface, then + * it is indeed a MUC. */ + if (tp_proxy_has_interface_by_id (priv->channel, + EMP_IFACE_QUARK_CHANNEL_INTERFACE_CONFERENCE)) { + return; + } + /* This is an MSN-like chat where anyone can join the chat at anytime. * If there is only one non-self contact member, we are in a private * chat and we set the "remote-contact" property to that contact. If -- cgit v1.2.3