Now checks for exitence of contact before sending message

This commit is contained in:
James Booth
2012-10-04 23:18:48 +01:00
parent 9e23060986
commit e486114e05
4 changed files with 44 additions and 12 deletions

View File

@@ -20,6 +20,8 @@
*
*/
#include <string.h>
#include "contact.h"
#include "prof_autocomplete.h"
@@ -70,3 +72,19 @@ find_contact(char *search_str)
{
return p_autocomplete_complete(ac, search_str);
}
PContact
contact_list_get_contact(const char const *jid)
{
GSList *contacts = get_contact_list();
while (contacts != NULL) {
PContact contact = contacts->data;
if (strcmp(p_contact_name(contact), jid) == 0) {
return contact;
}
contacts = g_slist_next(contacts);
}
return NULL;
}