]> www.infradead.org Git - pidgin-chime.git/commitdiff
Add chime_connection_contact_by_id()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 11 Aug 2017 22:26:46 +0000 (23:26 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 11 Aug 2017 22:26:46 +0000 (23:26 +0100)
chime-contact.c
chime-contact.h

index 6d685f201c4432c32113bf8ae657b3381438c45b..df1b6def82cd39d9a149c63d9a686d24cd1c0816 100644 (file)
@@ -614,6 +614,16 @@ ChimeContact *chime_connection_contact_by_email(ChimeConnection *cxn,
        return g_hash_table_lookup(priv->contacts.by_name, email);
 }
 
+ChimeContact *chime_connection_contact_by_id(ChimeConnection *cxn,
+                                            const gchar *id)
+{
+       g_return_val_if_fail(CHIME_IS_CONNECTION(cxn), NULL);
+       g_return_val_if_fail(id != NULL, NULL);
+       ChimeConnectionPrivate *priv = CHIME_CONNECTION_GET_PRIVATE (cxn);
+
+       return g_hash_table_lookup(priv->contacts.by_id, id);
+}
+
 struct foreach_contact_st {
        ChimeConnection *cxn;
        ChimeContactCB cb;
index d1737886cc27d80e72af8d20178c56e11b585222..730ace91324a6135b21b24fe5a1a386247f719e2 100644 (file)
@@ -65,6 +65,8 @@ gboolean chime_contact_get_contacts_list(ChimeContact *contact);
 
 ChimeContact *chime_connection_contact_by_email(ChimeConnection *cxn,
                                                const gchar *email);
+ChimeContact *chime_connection_contact_by_id(ChimeConnection *cxn,
+                                            const gchar *id);
 
 /* Designed to match the NEW_CONTACT signal handler */
 typedef void (*ChimeContactCB) (ChimeConnection *, ChimeContact *, gpointer);