summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJonathan Sieber <mail@strfry.org>2017-07-06 13:25:00 +0200
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-07-06 13:25:00 +0200
commit5747d81d959ce156fcfc8ca4ebe0b89f72d6b9d5 (patch)
treea46da4d5a425111651d7249bf8f7c5e0bb7679dd /include
parenteb6b93a8820041ec0bf587eece7c281c40c1da14 (diff)
Presence: Handle contacts added at run-time (#276)
* Add contact_presence getter * Add contact_remove() function * presence: Handle contacts added at runtime
Diffstat (limited to 'include')
-rw-r--r--include/baresip.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/baresip.h b/include/baresip.h
index de83fe4..d1c8524 100644
--- a/include/baresip.h
+++ b/include/baresip.h
@@ -283,18 +283,28 @@ enum presence_status {
PRESENCE_BUSY
};
+
+struct contact;
+typedef void (contact_update_h)(struct contact *c, bool remove, void *arg);
+
struct contacts {
struct list cl;
struct hash *cht;
+
+ contact_update_h *handler;
+ void* handler_arg;
};
-struct contact;
int contact_init(struct contacts *contacts);
void contact_close(struct contacts *contacts);
int contact_add(struct contacts *contacts,
struct contact **contactp, const struct pl *addr);
+void contact_remove(struct contacts *contacts, struct contact *c);
+void contact_set_update_handler(struct contacts *contacs,
+ contact_update_h *updateh, void *arg);
int contacts_print(struct re_printf *pf, const struct contacts *contacts);
+enum presence_status contact_presence(const struct contact *c);
void contact_set_presence(struct contact *c, enum presence_status status);
bool contact_block_access(const struct contacts *contacts, const char *uri);
struct contact *contact_find(const struct contacts *contacts,