1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Bind roster functions in main.c

This commit is contained in:
James Booth 2013-12-22 23:34:44 +00:00
parent 4e169689f6
commit 6a9bb8ea11
3 changed files with 13 additions and 6 deletions

View File

@ -45,6 +45,7 @@ _init_modules(void)
iq_init_module(); iq_init_module();
message_init_module(); message_init_module();
presence_init_module(); presence_init_module();
roster_init_module();
} }
int int

View File

@ -90,7 +90,6 @@ _roster_add_new(const char * const barejid, const char * const name)
xmpp_send(conn, iq); xmpp_send(conn, iq);
xmpp_stanza_release(iq); xmpp_stanza_release(iq);
} }
void (*roster_add_new)(const char * const, const char * const) = _roster_add_new;
static void static void
_roster_send_remove(const char * const barejid) _roster_send_remove(const char * const barejid)
@ -101,7 +100,6 @@ _roster_send_remove(const char * const barejid)
xmpp_send(conn, iq); xmpp_send(conn, iq);
xmpp_stanza_release(iq); xmpp_stanza_release(iq);
} }
void (*roster_send_remove)(const char * const) = _roster_send_remove;
static void static void
_roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups) _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_send(conn, iq);
xmpp_stanza_release(iq); xmpp_stanza_release(iq);
} }
void (*roster_send_name_change)(const char * const, const char * const,
GSList *) = _roster_send_name_change;
static void static void
_roster_send_add_to_group(const char * const group, PContact contact) _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); xmpp_stanza_release(iq);
free(unique_id); free(unique_id);
} }
void (*roster_send_add_to_group)(const char * const, PContact) = _roster_send_add_to_group;
static int static int
_group_add_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, _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); xmpp_stanza_release(iq);
free(unique_id); free(unique_id);
} }
void (*roster_send_remove_from_group)(const char * const, PContact) = _roster_send_remove_from_group;
static int static int
_group_remove_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, _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; 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;
}

View File

@ -80,6 +80,7 @@ void capabilities_init_module(void);
void iq_init_module(void); void iq_init_module(void);
void message_init_module(void); void message_init_module(void);
void presence_init_module(void); void presence_init_module(void);
void roster_init_module(void);
// connection functions // connection functions
void (*jabber_init)(const int disable_tls); void (*jabber_init)(const int disable_tls);