summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2009-11-12 10:58:34 +0000
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-12 11:01:53 +0000
commit5c99eaa8f14e248d8113de516e3550231b652337 (patch)
tree203e51d07c8c306c4e96546aaa71d9a2a6470a8a
parent05138abca45f3a9cb21112ac5ce32dda5f978061 (diff)
downloadempathy-5c99eaa8f14e248d8113de516e3550231b652337.tar.gz
Force an unset presence type to appear as offline in the presence chooser and status icon.
An unset presence type *does* make sense, but not in these contexts. As an aside, there is no icon for an unset presence, so nothing is displayed, which is bad. Fixes bug #597819
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c6
-rw-r--r--src/empathy-status-icon.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index 21f1eaad7..053c38aec 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -920,6 +920,12 @@ presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser)
status = empathy_idle_get_status (priv->idle);
flash_state = empathy_idle_get_flash_state (priv->idle);
+ /* An unset presence here doesn't make any sense. Force it to appear as
+ * offline. */
+ if (state == TP_CONNECTION_PRESENCE_TYPE_UNSET) {
+ state = TP_CONNECTION_PRESENCE_TYPE_OFFLINE;
+ }
+
/* look through the model and attempt to find a matching state */
model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser));
for (valid = gtk_tree_model_get_iter_first (model, &iter);
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index ec083e42d..ba94eecf8 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -243,6 +243,13 @@ status_icon_update_icon (EmpathyStatusIcon *icon)
TpConnectionPresenceType state;
state = empathy_idle_get_state (priv->idle);
+
+ /* An unset presence type here doesn't make sense. Force it
+ * to be offline. */
+ if (state == TP_CONNECTION_PRESENCE_TYPE_UNSET) {
+ state = TP_CONNECTION_PRESENCE_TYPE_OFFLINE;
+ }
+
icon_name = empathy_icon_name_for_presence (state);
}