Only create contacts resource when online

This commit is contained in:
James Booth
2013-02-10 11:19:36 +00:00
parent 84a4ab9545
commit ec78914044
6 changed files with 98 additions and 118 deletions

View File

@@ -64,14 +64,13 @@ contact_list_reset_search_attempts(void)
gboolean
contact_list_add(const char * const barejid, const char * const name,
const char * const presence, const char * const status,
const char * const subscription, gboolean pending_out)
{
gboolean added = FALSE;
PContact contact = g_hash_table_lookup(contacts, barejid);
if (contact == NULL) {
contact = p_contact_new(barejid, name, presence, status, subscription,
contact = p_contact_new(barejid, name, "offline", NULL, subscription,
pending_out, NULL);
g_hash_table_insert(contacts, strdup(barejid), contact);
autocomplete_add(ac, strdup(barejid));