Kaydet (Commit) 451dbe39 authored tarafından Will Thompson's avatar Will Thompson Kaydeden (comit) Matúš Kukan

tubes: skip self contact

You should only have yourself on your contact list on rare occasions,
but…
üst 7fe5d1af
...@@ -92,6 +92,7 @@ AccountContactPairV ContactList::getContacts() ...@@ -92,6 +92,7 @@ AccountContactPairV ContactList::getContacts()
{ {
TpAccount *account = reinterpret_cast<TpAccount *>(accounts->data); TpAccount *account = reinterpret_cast<TpAccount *>(accounts->data);
TpConnection *connection = tp_account_get_connection (account); TpConnection *connection = tp_account_get_connection (account);
TpContact *self;
GPtrArray *contacts; GPtrArray *contacts;
guint i; guint i;
...@@ -103,13 +104,15 @@ AccountContactPairV ContactList::getContacts() ...@@ -103,13 +104,15 @@ AccountContactPairV ContactList::getContacts()
TP_CONTACT_LIST_STATE_SUCCESS) TP_CONTACT_LIST_STATE_SUCCESS)
continue; continue;
self = tp_connection_get_self_contact (connection);
contacts = tp_connection_dup_contact_list (connection); contacts = tp_connection_dup_contact_list (connection);
for (i = 0; i < contacts->len; i++) for (i = 0; i < contacts->len; i++)
{ {
TpContact *contact = TpContact *contact =
reinterpret_cast<TpContact *>(g_ptr_array_index (contacts, i)); reinterpret_cast<TpContact *>(g_ptr_array_index (contacts, i));
if (contact_supports_libo_dtube (contact)) if (contact != self &&
contact_supports_libo_dtube (contact))
{ {
g_object_ref (account); g_object_ref (account);
g_object_ref (contact); g_object_ref (contact);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment