From 74e8a405d6f5574e4e0e5d08e89ad1931a33ba6d Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 22 Dec 2013 23:25:30 +0000 Subject: [PATCH] Bind message functions in main.c --- src/main.c | 1 + src/xmpp/message.c | 22 +++++++++++++--------- src/xmpp/xmpp.h | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main.c b/src/main.c index d933a03c..e2366cfc 100644 --- a/src/main.c +++ b/src/main.c @@ -43,6 +43,7 @@ _init_modules(void) bookmark_init_module(); capabilities_init_module(); iq_init_module(); + message_init_module(); } int diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 605461ef..482a3965 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -89,7 +89,6 @@ _message_send(const char * const msg, const char * const recipient) xmpp_send(conn, message); xmpp_stanza_release(message); } -void (*message_send)(const char * const, const char * const) = _message_send; static void _message_send_groupchat(const char * const msg, const char * const recipient) @@ -102,7 +101,6 @@ _message_send_groupchat(const char * const msg, const char * const recipient) xmpp_send(conn, message); xmpp_stanza_release(message); } -void (*message_send_groupchat)(const char * const, const char * const) = _message_send_groupchat; static void _message_send_duck(const char * const query) @@ -115,7 +113,6 @@ _message_send_duck(const char * const query) xmpp_send(conn, message); xmpp_stanza_release(message); } -void (*message_send_duck)(const char * const) = _message_send_duck; static void _message_send_invite(const char * const room, const char * const contact, @@ -128,8 +125,6 @@ _message_send_invite(const char * const room, const char * const contact, xmpp_send(conn, stanza); xmpp_stanza_release(stanza); } -void (*message_send_invite)(const char * const, const char * const, - const char * const) = _message_send_invite; static void _message_send_composing(const char * const recipient) @@ -143,7 +138,6 @@ _message_send_composing(const char * const recipient) xmpp_stanza_release(stanza); chat_session_set_sent(recipient); } -void (*message_send_composing)(const char * const) = _message_send_composing; static void _message_send_paused(const char * const recipient) @@ -157,7 +151,6 @@ _message_send_paused(const char * const recipient) xmpp_stanza_release(stanza); chat_session_set_sent(recipient); } -void (*message_send_paused)(const char * const) = _message_send_paused; static void _message_send_inactive(const char * const recipient) @@ -171,7 +164,6 @@ _message_send_inactive(const char * const recipient) xmpp_stanza_release(stanza); chat_session_set_sent(recipient); } -void (*message_send_inactive)(const char * const) = _message_send_inactive; static void _message_send_gone(const char * const recipient) @@ -185,7 +177,6 @@ _message_send_gone(const char * const recipient) xmpp_stanza_release(stanza); chat_session_set_sent(recipient); } -void (*message_send_gone)(const char * const) = _message_send_gone; static int _conference_message_handler(xmpp_conn_t * const conn, @@ -448,3 +439,16 @@ _chat_message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, } } +void +message_init_module(void) +{ + message_send = _message_send; + message_send_groupchat = _message_send_groupchat; + message_send_duck = _message_send_duck; + message_send_invite = _message_send_invite; + message_send_composing = _message_send_composing; + message_send_paused = _message_send_paused; + message_send_inactive = _message_send_inactive; + message_send_gone = _message_send_gone; +} + diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 1ad5d8ff..29668403 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -78,6 +78,7 @@ void jabber_init_module(void); void bookmark_init_module(void); void capabilities_init_module(void); void iq_init_module(void); +void message_init_module(void); // connection functions void (*jabber_init)(const int disable_tls);