summaryrefslogtreecommitdiff
path: root/tubes/source/contact-list.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tubes/source/contact-list.cxx')
-rw-r--r--tubes/source/contact-list.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/tubes/source/contact-list.cxx b/tubes/source/contact-list.cxx
index 0d4680358fd3..78f84b534417 100644
--- a/tubes/source/contact-list.cxx
+++ b/tubes/source/contact-list.cxx
@@ -92,6 +92,15 @@ tb_contact_is_online (TpContact *contact)
}
}
+static void presence_changed_cb( TpContact* /* contact */,
+ guint /* type */,
+ gchar* /* status */,
+ gchar* /* message */,
+ gpointer pContactList )
+{
+ reinterpret_cast<ContactList*> (pContactList)->sigContactListChanged();
+}
+
AccountContactPairV ContactList::getContacts()
{
GList *accounts;
@@ -121,6 +130,12 @@ AccountContactPairV ContactList::getContacts()
{
TpContact *contact =
reinterpret_cast<TpContact *>(g_ptr_array_index (contacts, i));
+ if (maRegistered.find (contact) == maRegistered.end())
+ {
+ maRegistered.insert (contact);
+ g_signal_connect (contact, "presence-changed",
+ G_CALLBACK (presence_changed_cb), this );
+ }
if (contact != self &&
tb_contact_is_online (contact))