From 6a9bb8ea1102e85a9dc77947ac3b10375a551bb1 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 22 Dec 2013 23:34:44 +0000 Subject: [PATCH] Bind roster functions in main.c --- src/main.c | 1 + src/xmpp/roster.c | 17 +++++++++++------ src/xmpp/xmpp.h | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index b27240fa..d1a99556 100644 --- a/src/main.c +++ b/src/main.c @@ -45,6 +45,7 @@ _init_modules(void) iq_init_module(); message_init_module(); presence_init_module(); + roster_init_module(); } int diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c index c7fc71fe..7d4b0efe 100644 --- a/src/xmpp/roster.c +++ b/src/xmpp/roster.c @@ -90,7 +90,6 @@ _roster_add_new(const char * const barejid, const char * const name) xmpp_send(conn, iq); xmpp_stanza_release(iq); } -void (*roster_add_new)(const char * const, const char * const) = _roster_add_new; static void _roster_send_remove(const char * const barejid) @@ -101,7 +100,6 @@ _roster_send_remove(const char * const barejid) xmpp_send(conn, iq); xmpp_stanza_release(iq); } -void (*roster_send_remove)(const char * const) = _roster_send_remove; static void _roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups) @@ -113,8 +111,6 @@ _roster_send_name_change(const char * const barejid, const char * const new_name xmpp_send(conn, iq); xmpp_stanza_release(iq); } -void (*roster_send_name_change)(const char * const, const char * const, - GSList *) = _roster_send_name_change; static void _roster_send_add_to_group(const char * const group, PContact contact) @@ -146,7 +142,6 @@ _roster_send_add_to_group(const char * const group, PContact contact) xmpp_stanza_release(iq); free(unique_id); } -void (*roster_send_add_to_group)(const char * const, PContact) = _roster_send_add_to_group; static int _group_add_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, @@ -194,7 +189,6 @@ _roster_send_remove_from_group(const char * const group, PContact contact) xmpp_stanza_release(iq); free(unique_id); } -void (*roster_send_remove_from_group)(const char * const, PContact) = _roster_send_remove_from_group; static int _group_remove_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, @@ -329,3 +323,14 @@ _get_groups_from_item(xmpp_stanza_t *item) return groups; } + +void +roster_init_module(void) +{ + roster_add_new = _roster_add_new; + roster_send_remove = _roster_send_remove; + roster_send_name_change = _roster_send_name_change; + roster_send_add_to_group = _roster_send_add_to_group; + roster_send_remove_from_group = _roster_send_remove_from_group; + +} diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 9817cc1f..90b17e59 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -80,6 +80,7 @@ void capabilities_init_module(void); void iq_init_module(void); void message_init_module(void); void presence_init_module(void); +void roster_init_module(void); // connection functions void (*jabber_init)(const int disable_tls);