diff options
Diffstat (limited to 'tubes/source/contact-list.cxx')
-rw-r--r-- | tubes/source/contact-list.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tubes/source/contact-list.cxx b/tubes/source/contact-list.cxx index 1b27af23adf8..b238a2cc24be 100644 --- a/tubes/source/contact-list.cxx +++ b/tubes/source/contact-list.cxx @@ -71,9 +71,9 @@ ContactList::~ContactList() mpAccountManager = NULL; } -bool tb_contact_is_online( TpContact *contact ) +bool tb_presence_is_online( const TpConnectionPresenceType& presence ) { - switch (tp_contact_get_presence_type (contact)) + switch (presence) { case TP_CONNECTION_PRESENCE_TYPE_UNSET: case TP_CONNECTION_PRESENCE_TYPE_OFFLINE: @@ -91,6 +91,16 @@ bool tb_contact_is_online( TpContact *contact ) } } +bool tb_account_is_online( TpAccount *account ) +{ + return tb_presence_is_online (tp_account_get_current_presence (account, NULL, NULL)); +} + +bool tb_contact_is_online( TpContact *contact ) +{ + return tb_presence_is_online (tp_contact_get_presence_type (contact)); +} + namespace tubes { void reDrawAllContacts(); } |