aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/empathy-main-window.c35
-rw-r--r--src/empathy-status-icon.c2
-rw-r--r--src/empathy.c5
3 files changed, 25 insertions, 17 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index d2cb832f2..e53807236 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -563,8 +563,8 @@ main_window_connection_changed_cb (EmpathyAccountManager *manager,
static void
main_window_contact_presence_changed_cb (EmpathyContactMonitor *monitor,
EmpathyContact *contact,
- McPresence current,
- McPresence previous,
+ TpConnectionPresenceType current,
+ TpConnectionPresenceType previous,
EmpathyMainWindow *window)
{
McAccount *account;
@@ -577,18 +577,25 @@ main_window_contact_presence_changed_cb (EmpathyContactMonitor *monitor,
return;
}
- if (previous < MC_PRESENCE_AVAILABLE && current > MC_PRESENCE_OFFLINE) {
- /* someone is logging in */
- empathy_sound_play (GTK_WIDGET (window->window),
- EMPATHY_SOUND_CONTACT_CONNECTED);
- return;
- }
-
- if (previous > MC_PRESENCE_OFFLINE && current < MC_PRESENCE_AVAILABLE) {
- /* someone is logging off */
- empathy_sound_play (GTK_WIDGET (window->window),
- EMPATHY_SOUND_CONTACT_DISCONNECTED);
- }
+ if (tp_connection_presence_type_cmp_availability (previous,
+ TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0)
+ {
+ /* contact was online */
+ if (tp_connection_presence_type_cmp_availability (current,
+ TP_CONNECTION_PRESENCE_TYPE_OFFLINE) <= 0)
+ /* someone is logging off */
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_SOUND_CONTACT_DISCONNECTED);
+ }
+ else
+ {
+ /* contact was offline */
+ if (tp_connection_presence_type_cmp_availability (current,
+ TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0)
+ /* someone is logging in */
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_SOUND_CONTACT_CONNECTED);
+ }
}
static void
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 5d45e83f3..cca2557a8 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -195,7 +195,7 @@ status_icon_update_icon (EmpathyStatusIcon *icon)
if (priv->event && priv->showing_event_icon) {
icon_name = priv->event->icon_name;
} else {
- McPresence state;
+ TpConnectionPresenceType state;
state = empathy_idle_get_state (priv->idle);
icon_name = empathy_icon_name_for_presence (state);
diff --git a/src/empathy.c b/src/empathy.c
index 91d77a5e6..72cccb55e 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -545,7 +545,8 @@ main (int argc, char *argv[])
EMPATHY_PREFS_AUTOCONNECT,
&autoconnect);
if (autoconnect && ! no_connect &&
- empathy_idle_get_state (idle) <= MC_PRESENCE_OFFLINE) {
+ tp_connection_presence_type_cmp_availability (empathy_idle_get_state
+ (idle), TP_CONNECTION_PRESENCE_TYPE_OFFLINE) <= 0) {
empathy_idle_set_state (idle, MC_PRESENCE_AVAILABLE);
}
@@ -583,7 +584,7 @@ main (int argc, char *argv[])
gtk_main ();
- empathy_idle_set_state (idle, MC_PRESENCE_OFFLINE);
+ empathy_idle_set_state (idle, TP_CONNECTION_PRESENCE_TYPE_OFFLINE);
g_object_unref (mc);
g_object_unref (idle);