aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-04-21 04:12:34 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-04-21 04:12:34 +0800
commit33988c3c94a292b6a54dfff52eac2e3d1c511e54 (patch)
tree815c479f887296df74e106f7c17779c450f0ee8d
parent1f4cd4f8077ba939917496c7fe7c95604995223b (diff)
downloadgsoc2013-empathy-33988c3c94a292b6a54dfff52eac2e3d1c511e54.tar
gsoc2013-empathy-33988c3c94a292b6a54dfff52eac2e3d1c511e54.tar.gz
gsoc2013-empathy-33988c3c94a292b6a54dfff52eac2e3d1c511e54.tar.bz2
gsoc2013-empathy-33988c3c94a292b6a54dfff52eac2e3d1c511e54.tar.lz
gsoc2013-empathy-33988c3c94a292b6a54dfff52eac2e3d1c511e54.tar.xz
gsoc2013-empathy-33988c3c94a292b6a54dfff52eac2e3d1c511e54.tar.zst
gsoc2013-empathy-33988c3c94a292b6a54dfff52eac2e3d1c511e54.zip
Never set the remote_contact for named rooms, do not pretend it's a p2p chat when on a muc with only one other contact.
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1015 4ee84921-47dd-4033-b63a-18d7a039a3e4
-rw-r--r--libempathy/empathy-tp-chat.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 34fcf64dc..7e26e34a7 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -123,8 +123,18 @@ tp_chat_member_added_cb (EmpathyTpGroup *group,
EmpathyTpChat *chat)
{
EmpathyTpChatPriv *priv = GET_PRIV (chat);
+ guint handle_type = 0;
priv->members_count++;
+ g_signal_emit_by_name (chat, "members-changed",
+ contact, actor, reason, message,
+ TRUE);
+
+ g_object_get (priv->channel, "handle-type", &handle_type, NULL);
+ if (handle_type == TP_HANDLE_TYPE_ROOM) {
+ return;
+ }
+
if (priv->members_count > 2 && priv->remote_contact) {
/* We now have more than 2 members, this is not a p2p chat
* anymore. Remove the remote-contact as it makes no sense, the
@@ -142,10 +152,6 @@ tp_chat_member_added_cb (EmpathyTpGroup *group,
priv->remote_contact = g_object_ref (contact);
g_object_notify (G_OBJECT (chat), "remote-contact");
}
-
- g_signal_emit_by_name (chat, "members-changed",
- contact, actor, reason, message,
- TRUE);
}
static void
@@ -157,8 +163,18 @@ tp_chat_member_removed_cb (EmpathyTpGroup *group,
EmpathyTpChat *chat)
{
EmpathyTpChatPriv *priv = GET_PRIV (chat);
+ guint handle_type = 0;
priv->members_count--;
+ g_signal_emit_by_name (chat, "members-changed",
+ contact, actor, reason, message,
+ FALSE);
+
+ g_object_get (priv->channel, "handle-type", &handle_type, NULL);
+ if (handle_type == TP_HANDLE_TYPE_ROOM) {
+ return;
+ }
+
if (priv->members_count <= 2 && !priv->remote_contact) {
GList *members, *l;
@@ -174,11 +190,8 @@ tp_chat_member_removed_cb (EmpathyTpGroup *group,
g_list_foreach (members, (GFunc) g_object_unref, NULL);
g_list_free (members);
}
-
- g_signal_emit_by_name (chat, "members-changed",
- contact, actor, reason, message,
- FALSE);
}
+
static void
tp_chat_local_pending_cb (EmpathyTpGroup *group,
EmpathyContact *contact,