aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog11
-rw-r--r--libempathy-gtk/gossip-contact-list-store.c8
-rw-r--r--libempathy-gtk/gossip-contact-list-view.c25
-rw-r--r--libempathy-gtk/gossip-new-chatroom-dialog.c6
-rw-r--r--libempathy/empathy-tp-contact-list.c42
5 files changed, 55 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index 68483d99d..d58dfaf07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
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
for jabber protocol to conference.server. This fixes a warning.
diff --git a/libempathy-gtk/gossip-contact-list-store.c b/libempathy-gtk/gossip-contact-list-store.c
index 816102b2d..c8a43ed5a 100644
--- a/libempathy-gtk/gossip-contact-list-store.c
+++ b/libempathy-gtk/gossip-contact-list-store.c
@@ -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;
diff --git a/libempathy-gtk/gossip-contact-list-view.c b/libempathy-gtk/gossip-contact-list-view.c
index b9ee7063f..3cad7821d 100644
--- a/libempathy-gtk/gossip-contact-list-view.c
+++ b/libempathy-gtk/gossip-contact-list-view.c
@@ -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
}
}
diff --git a/libempathy-gtk/gossip-new-chatroom-dialog.c b/libempathy-gtk/gossip-new-chatroom-dialog.c
index 33c6f723e..838f90a74 100644
--- a/libempathy-gtk/gossip-new-chatroom-dialog.c
+++ b/libempathy-gtk/gossip-new-chatroom-dialog.c
@@ -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 ();
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));