]> git.0d.be Git - empathy.git/commitdiff
Do not use the server entry's value if it's hidden. Do not highlight
authorXavier Claessens <xclaesse@gmail.com>
Fri, 25 May 2007 11:05:23 +0000 (11:05 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 25 May 2007 11:05:23 +0000 (11:05 +0000)
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

ChangeLog
libempathy-gtk/gossip-contact-list-store.c
libempathy-gtk/gossip-contact-list-view.c
libempathy-gtk/gossip-new-chatroom-dialog.c
libempathy/empathy-tp-contact-list.c

index 68483d99d57fbde0677964765d47612760f60d95..d58dfaf07e8e5631a9721ea3176211ca90a20262 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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.
+
 2007-05-25  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/gossip-new-chatroom-dialog.c: Preset the server only
index 816102b2ddc2ae2b582df9574f5bf2189864d9ab..c8a43ed5ab1a7ab5a7705cb387f99c7376575e7d 100644 (file)
@@ -1164,10 +1164,10 @@ contact_list_store_get_group_foreach (GtkTreeModel *model,
 
 static void
 contact_list_store_get_group (GossipContactListStore *store,
-                             const gchar       *name,
-                             GtkTreeIter       *iter_group_to_set,
-                             GtkTreeIter       *iter_separator_to_set,
-                             gboolean          *created)
+                             const gchar            *name,
+                             GtkTreeIter            *iter_group_to_set,
+                             GtkTreeIter            *iter_separator_to_set,
+                             gboolean               *created)
 {
        GossipContactListStorePriv *priv;
        GtkTreeModel               *model;
index b9ee7063f6ce2860ee31e25abe881f6afdd35bff..3cad7821d71f278ecdb395b36a6c54b8f1f8196a 100644 (file)
@@ -1079,32 +1079,9 @@ contact_list_view_cell_set_background (GossipContactListView *view,
                                      NULL);
                }
        } else {
-#if 0
-               gint color_sum_normal;
-               gint color_sum_selected;
-               
-               color = style->base[GTK_STATE_SELECTED];
-               color_sum_normal = color.red+color.green+color.blue;
-               color = style->base[GTK_STATE_NORMAL];
-               color_sum_selected = color.red+color.green+color.blue;
-               color = style->text_aa[GTK_STATE_INSENSITIVE];
-
-               if (color_sum_normal < color_sum_selected) { 
-                       /* Found a light theme */
-                       color.red = (color.red + (style->white).red) / 2;
-                       color.green = (color.green + (style->white).green) / 2;
-                       color.blue = (color.blue + (style->white).blue) / 2;
-               } else { 
-                       /* Found a dark theme */
-                       color.red = (color.red + (style->black).red) / 2;
-                       color.green = (color.green + (style->black).green) / 2;
-                       color.blue = (color.blue + (style->black).blue) / 2;
-               }
-
                g_object_set (cell,
-                             "cell-background-gdk", &color,
+                             "cell-background-gdk", NULL,
                              NULL);
-#endif
        }
 }
 
index 33c6f723e56475016a86e97893a02a2e0318814c..838f90a7436925f189b1c2f1e6bbb5b33995b9b7 100644 (file)
@@ -607,7 +607,7 @@ new_chatroom_dialog_join (GossipNewChatroomDialog *dialog)
        TpConn               *tp_conn;
        GList                *chatrooms, *l;
        const gchar          *room;
-       const gchar          *server;
+       const gchar          *server = NULL;
        gchar                *room_name = NULL;
        const gchar          *room_names[2] = {NULL, NULL};
 
@@ -621,7 +621,9 @@ new_chatroom_dialog_join (GossipNewChatroomDialog *dialog)
        }
 
        room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
-       server = gtk_entry_get_text (GTK_ENTRY (dialog->entry_server));
+       if (GTK_WIDGET_VISIBLE (dialog->hbox_server)) {
+               server = gtk_entry_get_text (GTK_ENTRY (dialog->entry_server));
+       }
        account_chooser = GOSSIP_ACCOUNT_CHOOSER (dialog->account_chooser);
        account = gossip_account_chooser_get_account (account_chooser);
        mc = gossip_mission_control_new ();
index 2ebb648a369041beec4a158f930048500a6c9c0a..0bbd46a9555459d9ccb42f9a564990bbb0fc3aa3 100644 (file)
@@ -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));