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

Dynamically bind xmpp module api

This commit is contained in:
James Booth 2013-12-18 20:16:55 +00:00
parent f47bd58a1c
commit 81909ef000
8 changed files with 192 additions and 141 deletions

View File

@ -61,8 +61,8 @@ bookmark_request(void)
xmpp_stanza_release(iq);
}
void
bookmark_add(const char *jid, const char *nick, gboolean autojoin)
static void
_bookmark_add(const char *jid, const char *nick, gboolean autojoin)
{
/* TODO: send request */
/* TODO: manage bookmark_list */
@ -71,9 +71,10 @@ bookmark_add(const char *jid, const char *nick, gboolean autojoin)
autocomplete_remove(bookmark_ac, jid);
autocomplete_add(bookmark_ac, jid);
}
void (*bookmark_add)(const char *, const char *, gboolean) = _bookmark_add;
void
bookmark_remove(const char *jid, gboolean autojoin)
static void
_bookmark_remove(const char *jid, gboolean autojoin)
{
/* TODO: manage bookmark_list */
if (autojoin) {
@ -83,26 +84,30 @@ bookmark_remove(const char *jid, gboolean autojoin)
autocomplete_remove(bookmark_ac, jid);
}
}
void (*bookmark_remove)(const char *, gboolean) = _bookmark_remove;
const GList *
bookmark_get_list(void)
static const GList *
_bookmark_get_list(void)
{
return bookmark_list;
}
const GList * (*bookmark_get_list)(void) = _bookmark_get_list;
char *
bookmark_find(char *search_str)
static char *
_bookmark_find(char *search_str)
{
return autocomplete_complete(bookmark_ac, search_str);
}
char * (*bookmark_find)(char *) = _bookmark_find;
void
bookmark_autocomplete_reset(void)
static void
_bookmark_autocomplete_reset(void)
{
if (bookmark_ac != NULL) {
autocomplete_reset(bookmark_ac);
}
}
void (*bookmark_autocomplete_reset)(void) = _bookmark_autocomplete_reset;
static int
_bookmark_handle_result(xmpp_conn_t * const conn,

View File

@ -107,11 +107,12 @@ caps_contains(const char * const caps_str)
return (g_hash_table_lookup(capabilities, caps_str) != NULL);
}
Capabilities *
caps_get(const char * const caps_str)
static Capabilities *
_caps_get(const char * const caps_str)
{
return g_hash_table_lookup(capabilities, caps_str);
}
Capabilities * (*caps_get)(const char * const) = _caps_get;
char *
caps_create_sha1_str(xmpp_stanza_t * const query)
@ -303,11 +304,12 @@ caps_create_query_response_stanza(xmpp_ctx_t * const ctx)
return query;
}
void
caps_close(void)
static void
_caps_close(void)
{
g_hash_table_destroy(capabilities);
}
void (*caps_close)(void) = _caps_close;
static void
_caps_destroy(Capabilities *caps)

View File

@ -91,8 +91,8 @@ void _connection_free_saved_account(void);
void _connection_free_saved_details(void);
void _connection_free_session_data(void);
void
jabber_init(const int disable_tls)
static void
_jabber_init(const int disable_tls)
{
log_info("Initialising XMPP");
jabber_conn.conn_status = JABBER_STARTED;
@ -107,9 +107,10 @@ jabber_init(const int disable_tls)
(GDestroyNotify)resource_destroy);
xmpp_initialize();
}
void (*jabber_init)(const int) = _jabber_init;
jabber_conn_status_t
jabber_connect_with_account(const ProfAccount * const account)
static jabber_conn_status_t
_jabber_connect_with_account(const ProfAccount * const account)
{
assert(account != NULL);
@ -127,9 +128,10 @@ jabber_connect_with_account(const ProfAccount * const account)
return result;
}
jabber_conn_status_t (*jabber_connect_with_account)(const ProfAccount * const) = _jabber_connect_with_account;
jabber_conn_status_t
jabber_connect_with_details(const char * const jid,
static jabber_conn_status_t
_jabber_connect_with_details(const char * const jid,
const char * const passwd, const char * const altdomain)
{
assert(jid != NULL);
@ -159,9 +161,11 @@ jabber_connect_with_details(const char * const jid,
log_info("Connecting without account, JID: %s", saved_details.jid);
return _jabber_connect(saved_details.jid, passwd, saved_details.altdomain);
}
jabber_conn_status_t (*jabber_connect_with_details)(const char * const,
const char * const, const char * const) = _jabber_connect_with_details;
void
jabber_disconnect(void)
static void
_jabber_disconnect(void)
{
// if connected, send end stream and wait for response
if (jabber_conn.conn_status == JABBER_CONNECTED) {
@ -189,15 +193,17 @@ jabber_disconnect(void)
FREE_SET_NULL(jabber_conn.presence_message);
FREE_SET_NULL(jabber_conn.domain);
}
void (*jabber_disconnect)(void) = _jabber_disconnect;
void
jabber_shutdown(void)
static void
_jabber_shutdown(void)
{
xmpp_shutdown();
}
void (*jabber_shutdown)(void) = _jabber_shutdown;
void
jabber_process_events(void)
static void
_jabber_process_events(void)
{
// run xmpp event loop if connected, connecting or disconnecting
if (jabber_conn.conn_status == JABBER_CONNECTED
@ -216,9 +222,10 @@ jabber_process_events(void)
}
}
void (*jabber_process_events)(void) = _jabber_process_events;
void
jabber_set_autoping(const int seconds)
static void
_jabber_set_autoping(const int seconds)
{
if (jabber_conn.conn_status == JABBER_CONNECTED) {
xmpp_timed_handler_delete(jabber_conn.conn, _ping_timed_handler);
@ -230,18 +237,21 @@ jabber_set_autoping(const int seconds)
}
}
}
void (*jabber_set_autoping)(const int) = _jabber_set_autoping;
GList *
jabber_get_available_resources(void)
static GList *
_jabber_get_available_resources(void)
{
return g_hash_table_get_values(available_resources);
}
GList * (*jabber_get_available_resources)(void) = _jabber_get_available_resources;
jabber_conn_status_t
jabber_get_connection_status(void)
static jabber_conn_status_t
_jabber_get_connection_status(void)
{
return (jabber_conn.conn_status);
}
jabber_conn_status_t (*jabber_get_connection_status)(void) = _jabber_get_connection_status;
xmpp_conn_t *
connection_get_conn(void)
@ -255,29 +265,33 @@ connection_get_ctx(void)
return jabber_conn.ctx;
}
const char *
jabber_get_fulljid(void)
static const char *
_jabber_get_fulljid(void)
{
return xmpp_conn_get_jid(jabber_conn.conn);
}
const char * (*jabber_get_fulljid)(void) = _jabber_get_fulljid;
const char *
jabber_get_domain(void)
static const char *
_jabber_get_domain(void)
{
return jabber_conn.domain;
}
const char * (*jabber_get_domain)(void) = _jabber_get_domain;
char *
jabber_get_presence_message(void)
static char *
_jabber_get_presence_message(void)
{
return jabber_conn.presence_message;
}
char * (*jabber_get_presence_message)(void) = _jabber_get_presence_message;
char *
jabber_get_account_name(void)
static char *
_jabber_get_account_name(void)
{
return saved_account.name;
}
char * (*jabber_get_account_name)(void) = _jabber_get_account_name;
void
connection_set_presence_message(const char * const message)

View File

@ -75,8 +75,8 @@ iq_add_handlers(void)
HANDLE(STANZA_NS_PING, STANZA_TYPE_GET, _iq_handle_ping_get);
}
void
iq_room_list_request(gchar *conferencejid)
static void
_iq_room_list_request(gchar *conferencejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -84,9 +84,10 @@ iq_room_list_request(gchar *conferencejid)
xmpp_send(conn, iq);
xmpp_stanza_release(iq);
}
void (*iq_room_list_request)(gchar *) = _iq_room_list_request;
void
iq_disco_info_request(gchar *jid)
static void
_iq_disco_info_request(gchar *jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -94,9 +95,10 @@ iq_disco_info_request(gchar *jid)
xmpp_send(conn, iq);
xmpp_stanza_release(iq);
}
void (*iq_disco_info_request)(gchar *) = _iq_disco_info_request;
void
iq_disco_items_request(gchar *jid)
static void
_iq_disco_items_request(gchar *jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -104,9 +106,10 @@ iq_disco_items_request(gchar *jid)
xmpp_send(conn, iq);
xmpp_stanza_release(iq);
}
void (*iq_disco_items_request)(gchar *) = _iq_disco_items_request;
void
iq_send_software_version(const char * const fulljid)
static void
_iq_send_software_version(const char * const fulljid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -114,6 +117,7 @@ iq_send_software_version(const char * const fulljid)
xmpp_send(conn, iq);
xmpp_stanza_release(iq);
}
void (*iq_send_software_version)(const char * const) = _iq_send_software_version;
static int
_iq_handle_error(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,

View File

@ -57,8 +57,8 @@ message_add_handlers(void)
HANDLE(NULL, NULL, _conference_message_handler);
}
void
message_send(const char * const msg, const char * const recipient)
static void
_message_send(const char * const msg, const char * const recipient)
{
const char * jid = NULL;
@ -89,9 +89,10 @@ 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;
void
message_send_groupchat(const char * const msg, const char * const recipient)
static void
_message_send_groupchat(const char * const msg, const char * const recipient)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -101,9 +102,10 @@ 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;
void
message_send_duck(const char * const query)
static void
_message_send_duck(const char * const query)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -113,9 +115,10 @@ 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;
void
message_send_invite(const char * const room, const char * const contact,
static void
_message_send_invite(const char * const room, const char * const contact,
const char * const reason)
{
xmpp_conn_t * const conn = connection_get_conn();
@ -125,9 +128,11 @@ 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;
void
message_send_composing(const char * const recipient)
static void
_message_send_composing(const char * const recipient)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -138,9 +143,10 @@ 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;
void
message_send_paused(const char * const recipient)
static void
_message_send_paused(const char * const recipient)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -151,9 +157,10 @@ 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;
void
message_send_inactive(const char * const recipient)
static void
_message_send_inactive(const char * const recipient)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -164,9 +171,10 @@ 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;
void
message_send_gone(const char * const recipient)
static void
_message_send_gone(const char * const recipient)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -177,6 +185,7 @@ 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,

View File

@ -80,8 +80,8 @@ presence_add_handlers(void)
HANDLE(NULL, NULL, _available_handler);
}
void
presence_subscription(const char * const jid, const jabber_subscr_t action)
static void
_presence_subscription(const char * const jid, const jabber_subscr_t action)
{
assert(jid != NULL);
@ -121,18 +121,21 @@ presence_subscription(const char * const jid, const jabber_subscr_t action)
jid_destroy(jidp);
}
void (*presence_subscription)(const char * const, const jabber_subscr_t) = _presence_subscription;
GSList *
presence_get_subscription_requests(void)
static GSList *
_presence_get_subscription_requests(void)
{
return autocomplete_get_list(sub_requests_ac);
}
GSList * (*presence_get_subscription_requests)(void) = _presence_get_subscription_requests;
gint
presence_sub_request_count(void)
static gint
_presence_sub_request_count(void)
{
return autocomplete_length(sub_requests_ac);
}
gint (*presence_sub_request_count)(void) = _presence_sub_request_count;
void
presence_free_sub_requests(void)
@ -146,14 +149,15 @@ presence_clear_sub_requests(void)
autocomplete_clear(sub_requests_ac);
}
char *
presence_sub_request_find(char * search_str)
static char *
_presence_sub_request_find(char * search_str)
{
return autocomplete_complete(sub_requests_ac, search_str);
}
char * (*presence_sub_request_find)(char *) = _presence_sub_request_find;
gboolean
presence_sub_request_exists(const char * const bare_jid)
static gboolean
_presence_sub_request_exists(const char * const bare_jid)
{
gboolean result = FALSE;
GSList *requests_p = autocomplete_get_list(sub_requests_ac);
@ -173,15 +177,17 @@ presence_sub_request_exists(const char * const bare_jid)
return result;
}
gboolean (*presence_sub_request_exists)(const char * const) = _presence_sub_request_exists;
void
presence_reset_sub_request_search(void)
static void
_presence_reset_sub_request_search(void)
{
autocomplete_reset(sub_requests_ac);
}
void (*presence_reset_sub_request_search)(void) = _presence_reset_sub_request_search;
void
presence_update(const resource_presence_t presence_type, const char * const msg,
static void
_presence_update(const resource_presence_t presence_type, const char * const msg,
const int idle)
{
if (jabber_get_connection_status() != JABBER_CONNECTED) {
@ -224,6 +230,8 @@ presence_update(const resource_presence_t presence_type, const char * const msg,
}
accounts_set_last_presence(jabber_get_account_name(), last);
}
void (*presence_update)(const resource_presence_t, const char * const,
const int) = _presence_update;
static void
_send_room_presence(xmpp_conn_t *conn, xmpp_stanza_t *presence)
@ -252,8 +260,8 @@ _send_room_presence(xmpp_conn_t *conn, xmpp_stanza_t *presence)
}
}
void
presence_join_room(Jid *jid)
static void
_presence_join_room(Jid *jid)
{
assert(jid != NULL);
assert(jid->fulljid != NULL);
@ -279,9 +287,10 @@ presence_join_room(Jid *jid)
muc_join_room(jid->barejid, jid->resourcepart);
}
void (*presence_join_room)(Jid *) = _presence_join_room;
void
presence_change_room_nick(const char * const room, const char * const nick)
static void
_presence_change_room_nick(const char * const room, const char * const nick)
{
assert(room != NULL);
assert(nick != NULL);
@ -309,9 +318,10 @@ presence_change_room_nick(const char * const room, const char * const nick)
free(full_room_jid);
}
void (*presence_change_room_nick)(const char * const, const char * const) = _presence_change_room_nick;
void
presence_leave_chat_room(const char * const room_jid)
static void
_presence_leave_chat_room(const char * const room_jid)
{
assert(room_jid != NULL);
@ -327,6 +337,7 @@ presence_leave_chat_room(const char * const room_jid)
xmpp_stanza_release(presence);
}
}
void (*presence_leave_chat_room)(const char * const) = _presence_leave_chat_room;
static int
_unsubscribed_handler(xmpp_conn_t * const conn,

View File

@ -81,8 +81,8 @@ roster_request(void)
xmpp_stanza_release(iq);
}
void
roster_add_new(const char * const barejid, const char * const name)
static void
_roster_add_new(const char * const barejid, const char * const name)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -90,9 +90,10 @@ 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;
void
roster_send_remove(const char * const barejid)
static void
_roster_send_remove(const char * const barejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -100,9 +101,10 @@ 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;
void
roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups)
static void
_roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -111,9 +113,11 @@ 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;
void
roster_send_add_to_group(const char * const group, PContact contact)
static void
_roster_send_add_to_group(const char * const group, PContact contact)
{
GSList *groups = p_contact_groups(contact);
GSList *new_groups = NULL;
@ -142,6 +146,7 @@ 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,
@ -157,8 +162,8 @@ _group_add_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
return 0;
}
void
roster_send_remove_from_group(const char * const group, PContact contact)
static void
_roster_send_remove_from_group(const char * const group, PContact contact)
{
GSList *groups = p_contact_groups(contact);
GSList *new_groups = NULL;
@ -189,6 +194,7 @@ 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,

View File

@ -75,65 +75,65 @@ typedef struct disco_identity_t {
} DiscoIdentity;
// connection functions
void jabber_init(const int disable_tls);
jabber_conn_status_t jabber_connect_with_details(const char * const jid,
void (*jabber_init)(const int disable_tls);
jabber_conn_status_t (*jabber_connect_with_details)(const char * const jid,
const char * const passwd, const char * const altdomain);
jabber_conn_status_t jabber_connect_with_account(const ProfAccount * const account);
void jabber_disconnect(void);
void jabber_shutdown(void);
void jabber_process_events(void);
const char * jabber_get_fulljid(void);
const char * jabber_get_domain(void);
jabber_conn_status_t jabber_get_connection_status(void);
char * jabber_get_presence_message(void);
void jabber_set_autoping(int seconds);
char* jabber_get_account_name(void);
GList * jabber_get_available_resources(void);
jabber_conn_status_t (*jabber_connect_with_account)(const ProfAccount * const account);
void (*jabber_disconnect)(void);
void (*jabber_shutdown)(void);
void (*jabber_process_events)(void);
const char * (*jabber_get_fulljid)(void);
const char * (*jabber_get_domain)(void);
jabber_conn_status_t (*jabber_get_connection_status)(void);
char * (*jabber_get_presence_message)(void);
void (*jabber_set_autoping)(int seconds);
char* (*jabber_get_account_name)(void);
GList * (*jabber_get_available_resources)(void);
// message functions
void message_send(const char * const msg, const char * const recipient);
void message_send_groupchat(const char * const msg, const char * const recipient);
void message_send_inactive(const char * const recipient);
void message_send_composing(const char * const recipient);
void message_send_paused(const char * const recipient);
void message_send_gone(const char * const recipient);
void message_send_invite(const char * const room, const char * const contact,
void (*message_send)(const char * const msg, const char * const recipient);
void (*message_send_groupchat)(const char * const msg, const char * const recipient);
void (*message_send_inactive)(const char * const recipient);
void (*message_send_composing)(const char * const recipient);
void (*message_send_paused)(const char * const recipient);
void (*message_send_gone)(const char * const recipient);
void (*message_send_invite)(const char * const room, const char * const contact,
const char * const reason);
void message_send_duck(const char * const query);
void (*message_send_duck)(const char * const query);
// presence functions
void presence_subscription(const char * const jid, const jabber_subscr_t action);
GSList* presence_get_subscription_requests(void);
gint presence_sub_request_count(void);
void presence_reset_sub_request_search(void);
char * presence_sub_request_find(char * search_str);
void presence_join_room(Jid *jid);
void presence_change_room_nick(const char * const room, const char * const nick);
void presence_leave_chat_room(const char * const room_jid);
void presence_update(resource_presence_t status, const char * const msg,
void (*presence_subscription)(const char * const jid, const jabber_subscr_t action);
GSList* (*presence_get_subscription_requests)(void);
gint (*presence_sub_request_count)(void);
void (*presence_reset_sub_request_search)(void);
char * (*presence_sub_request_find)(char * search_str);
void (*presence_join_room)(Jid *jid);
void (*presence_change_room_nick)(const char * const room, const char * const nick);
void (*presence_leave_chat_room)(const char * const room_jid);
void (*presence_update)(resource_presence_t status, const char * const msg,
int idle);
gboolean presence_sub_request_exists(const char * const bare_jid);
gboolean (*presence_sub_request_exists)(const char * const bare_jid);
// iq functions
void iq_send_software_version(const char * const fulljid);
void iq_room_list_request(gchar *conferencejid);
void iq_disco_info_request(gchar *jid);
void iq_disco_items_request(gchar *jid);
void (*iq_send_software_version)(const char * const fulljid);
void (*iq_room_list_request)(gchar *conferencejid);
void (*iq_disco_info_request)(gchar *jid);
void (*iq_disco_items_request)(gchar *jid);
// caps functions
Capabilities* caps_get(const char * const caps_str);
void caps_close(void);
Capabilities* (*caps_get)(const char * const caps_str);
void (*caps_close)(void);
void bookmark_add(const char *jid, const char *nick, gboolean autojoin);
void bookmark_remove(const char *jid, gboolean autojoin);
const GList *bookmark_get_list(void);
char *bookmark_find(char *search_str);
void bookmark_autocomplete_reset(void);
void (*bookmark_add)(const char *jid, const char *nick, gboolean autojoin);
void (*bookmark_remove)(const char *jid, gboolean autojoin);
const GList * (*bookmark_get_list)(void);
char * (*bookmark_find)(char *search_str);
void (*bookmark_autocomplete_reset)(void);
void roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups);
void roster_send_add_to_group(const char * const group, PContact contact);
void roster_send_remove_from_group(const char * const group, PContact contact);
void roster_add_new(const char * const barejid, const char * const name);
void roster_send_remove(const char * const barejid);
void (*roster_send_name_change)(const char * const barejid, const char * const new_name, GSList *groups);
void (*roster_send_add_to_group)(const char * const group, PContact contact);
void (*roster_send_remove_from_group)(const char * const group, PContact contact);
void (*roster_add_new)(const char * const barejid, const char * const name);
void (*roster_send_remove)(const char * const barejid);
#endif