aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-05-25 19:05:23 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-25 19:05:23 +0800
commitc946da8f9810d4f56c02f5147ff7265cb30e23cc (patch)
treeb20fc7de3cb5de8df4590ce505d5e8216dfc9d64 /libempathy
parent1e3b55ae48930c42c700f29b7e7f37af4052b66f (diff)
downloadgsoc2013-empathy-c946da8f9810d4f56c02f5147ff7265cb30e23cc.tar
gsoc2013-empathy-c946da8f9810d4f56c02f5147ff7265cb30e23cc.tar.gz
gsoc2013-empathy-c946da8f9810d4f56c02f5147ff7265cb30e23cc.tar.bz2
gsoc2013-empathy-c946da8f9810d4f56c02f5147ff7265cb30e23cc.tar.lz
gsoc2013-empathy-c946da8f9810d4f56c02f5147ff7265cb30e23cc.tar.xz
gsoc2013-empathy-c946da8f9810d4f56c02f5147ff7265cb30e23cc.tar.zst
gsoc2013-empathy-c946da8f9810d4f56c02f5147ff7265cb30e23cc.zip
Do not use the server entry's value if it's hidden. Do not highlight
2007-05-25 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/gossip-new-chatroom-dialog.c: Do not use the server entry's value if it's hidden. * libempathy-gtk/gossip-contact-list-view.c:Do not highlight groups when adding them in the roster. * libempathy/empathy-tp-contact-list.c: DO not create new GossipContact object in presence/avatar/alias changed signal if we don't already know that contact from a contact list channel. This should fix DBus max pending calls limit reached in some cases. svn path=/trunk/; revision=93
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-list.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index 2ebb648a3..0bbd46a95 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -50,6 +50,7 @@ struct _EmpathyTpContactListPriv {
McAccount *account;
MissionControl *mc;
GossipContact *user_contact;
+ gboolean setup;
GossipTelepathyGroup *known;
GossipTelepathyGroup *publish;
@@ -402,6 +403,7 @@ tp_contact_list_setup (EmpathyContactList *list)
gossip_debug (DEBUG_DOMAIN, "setup contact list: %p", list);
+ priv->setup = TRUE;
dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->tp_conn), "NewChannel",
G_CALLBACK (tp_contact_list_newchannel_cb),
list, NULL);
@@ -431,10 +433,10 @@ tp_contact_list_setup (EmpathyContactList *list)
handle = g_value_get_uint (g_value_array_get_nth (chan_struct, 3));
tp_contact_list_newchannel_cb (DBUS_G_PROXY (priv->tp_conn),
- object_path, chan_iface,
- handle_type, handle,
- FALSE,
- EMPATHY_TP_CONTACT_LIST (list));
+ object_path, chan_iface,
+ handle_type, handle,
+ FALSE,
+ EMPATHY_TP_CONTACT_LIST (list));
g_value_array_free (chan_struct);
}
@@ -914,7 +916,8 @@ tp_contact_list_newchannel_cb (DBusGProxy *proxy,
priv = GET_PRIV (list);
if (strcmp (channel_type, TP_IFACE_CHANNEL_TYPE_CONTACT_LIST) != 0 ||
- suppress_handle) {
+ suppress_handle ||
+ !priv->setup) {
return;
}
@@ -1615,6 +1618,15 @@ tp_contact_list_avatar_update_cb (DBusGProxy *proxy,
gchar *new_token,
EmpathyTpContactList *list)
{
+ EmpathyTpContactListPriv *priv;
+
+ priv = GET_PRIV (list);
+
+ if (!g_hash_table_lookup (priv->contacts, GUINT_TO_POINTER (handle))) {
+ /* We don't know this contact, skip */
+ return;
+ }
+
gossip_debug (DEBUG_DOMAIN, "Changing avatar for %d to %s",
handle, new_token);
@@ -1659,7 +1671,10 @@ tp_contact_list_aliases_update_cb (DBusGProxy *proxy,
GPtrArray *renamed_handlers,
EmpathyTpContactList *list)
{
- gint i;
+ EmpathyTpContactListPriv *priv;
+ guint i;
+
+ priv = GET_PRIV (list);
for (i = 0; renamed_handlers->len > i; i++) {
guint handle;
@@ -1671,7 +1686,12 @@ tp_contact_list_aliases_update_cb (DBusGProxy *proxy,
handle = g_value_get_uint(g_value_array_get_nth (renamed_struct, 0));
alias = g_value_get_string(g_value_array_get_nth (renamed_struct, 1));
- if (alias && *alias == '\0') {
+ if (!g_hash_table_lookup (priv->contacts, GUINT_TO_POINTER (handle))) {
+ /* We don't know this contact, skip */
+ continue;
+ }
+
+ if (G_STR_EMPTY (alias)) {
alias = NULL;
}
@@ -1728,10 +1748,18 @@ tp_contact_list_parse_presence_foreach (guint handle,
GValueArray *presence_struct,
EmpathyTpContactList *list)
{
+ EmpathyTpContactListPriv *priv;
GHashTable *presences_table;
GossipContact *contact;
GossipPresence *presence = NULL;
+ priv = GET_PRIV (list);
+
+ if (!g_hash_table_lookup (priv->contacts, GUINT_TO_POINTER (handle))) {
+ /* We don't know this contact, skip */
+ return;
+ }
+
contact = empathy_tp_contact_list_get_from_handle (list, handle);
presences_table = g_value_get_boxed (g_value_array_get_nth (presence_struct, 1));