aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-main-window.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-05-31 03:15:31 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-05-31 04:15:42 +0800
commit327b8e56ecbaca67d550802f2fac741a78d81eb8 (patch)
tree62b8a9f51ecdcbfeae7dcdef81c4420d65a7aedc /src/empathy-main-window.c
parentf93b95e549591cc8302d894e44641f42751b7f67 (diff)
downloadgsoc2013-empathy-327b8e56ecbaca67d550802f2fac741a78d81eb8.tar
gsoc2013-empathy-327b8e56ecbaca67d550802f2fac741a78d81eb8.tar.gz
gsoc2013-empathy-327b8e56ecbaca67d550802f2fac741a78d81eb8.tar.bz2
gsoc2013-empathy-327b8e56ecbaca67d550802f2fac741a78d81eb8.tar.lz
gsoc2013-empathy-327b8e56ecbaca67d550802f2fac741a78d81eb8.tar.xz
gsoc2013-empathy-327b8e56ecbaca67d550802f2fac741a78d81eb8.tar.zst
gsoc2013-empathy-327b8e56ecbaca67d550802f2fac741a78d81eb8.zip
Remove usage of McPresence as much as possible
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r--src/empathy-main-window.c35
1 files changed, 21 insertions, 14 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