diff options
author | James Booth <boothj5@gmail.com> | 2013-02-10 18:16:06 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-02-10 18:16:06 +0000 |
commit | 8c9f91624646d22121166446f3c16edbcd7026b6 (patch) | |
tree | e4c3020d75f3012863a1040e38f7ed761c2bc862 /src/contact.c | |
parent | 1a6490a5b761087ad00d63dfa59d737318b0ceeb (diff) | |
download | profani-tty-8c9f91624646d22121166446f3c16edbcd7026b6.tar.gz |
Added p_contact_add_resource
Diffstat (limited to 'src/contact.c')
-rw-r--r-- | src/contact.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/contact.c b/src/contact.c index 9455929c..45ace58f 100644 --- a/src/contact.c +++ b/src/contact.c @@ -20,6 +20,7 @@ * */ +#include <assert.h> #include <stdlib.h> #include <string.h> @@ -40,9 +41,7 @@ struct p_contact_t { PContact p_contact_new(const char * const barejid, const char * const name, - const char * const presence, const char * const status, - const char * const subscription, gboolean pending_out, - const char * const caps_str) + const char * const subscription, gboolean pending_out) { PContact contact = malloc(sizeof(struct p_contact_t)); contact->barejid = strdup(barejid); @@ -63,16 +62,19 @@ p_contact_new(const char * const barejid, const char * const name, contact->available_resources = g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)resource_destroy); - // TODO, priority, last activity - if (g_strcmp0(presence, "offline") != 0) { - resource_presence_t resource_presence = resource_presence_from_string(presence); - Resource *resource = resource_new("default", resource_presence, status, 0, caps_str); - g_hash_table_insert(contact->available_resources, strdup(resource->name), resource); - } return contact; } +void +p_contact_add_resource(PContact contact, Resource *resource) +{ + assert(contact != NULL); + assert(resource != NULL); + + g_hash_table_insert(contact->available_resources, strdup(resource->name), resource); +} + PContact p_contact_new_subscription(const char * const barejid, const char * const subscription, gboolean pending_out) |