aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-status-icon.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-08-31 00:49:52 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-08-31 00:49:52 +0800
commit0b0bb0f621d8e1cda1508d9062a279459fc3b955 (patch)
tree03ad0e8b2180f5e3d6821fbab6315b33c7baf4d8 /libempathy-gtk/empathy-status-icon.c
parent3a535643a694d0dd1bed8e0b7a2fd6fd21e6ee0c (diff)
downloadgsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.gz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.bz2
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.lz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.xz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.zst
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.zip
Completely reworked ContactList API. Fixes bug #471611, bug #467280, bug #459540 and bug #462907.
svn path=/trunk/; revision=280
Diffstat (limited to 'libempathy-gtk/empathy-status-icon.c')
-rw-r--r--libempathy-gtk/empathy-status-icon.c49
1 files changed, 32 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-status-icon.c b/libempathy-gtk/empathy-status-icon.c
index 1ec1a21a5..1fdc00953 100644
--- a/libempathy-gtk/empathy-status-icon.c
+++ b/libempathy-gtk/empathy-status-icon.c
@@ -117,9 +117,12 @@ static void status_icon_quit_cb (GtkWidget *windo
EmpathyStatusIcon *icon);
static void status_icon_show_hide_window_cb (GtkWidget *widget,
EmpathyStatusIcon *icon);
-static void status_icon_local_pending_cb (EmpathyContactManager *manager,
- EmpathyContact *contact,
+static void status_icon_pendings_changed_cb (EmpathyContactManager *manager,
+ EmpathyContact *contact,
+ EmpathyContact *actor,
+ guint reason,
gchar *message,
+ gboolean is_pending,
EmpathyStatusIcon *icon);
static void status_icon_event_subscribe_cb (StatusIconEvent *event);
static void status_icon_event_flash_state_cb (StatusIconEvent *event);
@@ -148,7 +151,7 @@ static void
empathy_status_icon_init (EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv;
- GList *pending, *l;
+ GList *pendings, *l;
priv = GET_PRIV (icon);
@@ -177,21 +180,25 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
g_signal_connect (priv->icon, "popup-menu",
G_CALLBACK (status_icon_popup_menu_cb),
icon);
- g_signal_connect (priv->manager, "local-pending",
- G_CALLBACK (status_icon_local_pending_cb),
+ g_signal_connect (priv->manager, "pendings-changed",
+ G_CALLBACK (status_icon_pendings_changed_cb),
icon);
- pending = empathy_contact_list_get_local_pending (EMPATHY_CONTACT_LIST (priv->manager));
- for (l = pending; l; l = l->next) {
- EmpathyContactListInfo *info;
+ pendings = empathy_contact_list_get_pendings (EMPATHY_CONTACT_LIST (priv->manager));
+ for (l = pendings; l; l = l->next) {
+ EmpathyPendingInfo *info;
info = l->data;
- status_icon_local_pending_cb (priv->manager,
- info->contact,
- info->message,
- icon);
+ status_icon_pendings_changed_cb (priv->manager,
+ info->member,
+ info->actor,
+ 0,
+ info->message,
+ TRUE,
+ icon);
+ empathy_pending_info_free (info);
}
- g_list_free (pending);
+ g_list_free (pendings);
}
static void
@@ -533,10 +540,13 @@ status_icon_show_hide_window_cb (GtkWidget *widget,
}
static void
-status_icon_local_pending_cb (EmpathyContactManager *manager,
- EmpathyContact *contact,
- gchar *message,
- EmpathyStatusIcon *icon)
+status_icon_pendings_changed_cb (EmpathyContactManager *manager,
+ EmpathyContact *contact,
+ EmpathyContact *actor,
+ guint reason,
+ gchar *message,
+ gboolean is_pending,
+ EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv;
StatusIconEvent *event;
@@ -545,6 +555,11 @@ status_icon_local_pending_cb (EmpathyContactManager *manager,
priv = GET_PRIV (icon);
+ if (!is_pending) {
+ /* FIXME: We should remove the event */
+ return;
+ }
+
for (l = priv->events; l; l = l->next) {
if (empathy_contact_equal (contact, ((StatusIconEvent*)l->data)->user_data)) {
return;