From d16a31d0960d901d213428f171b7a712450a605c Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 21 May 2013 20:50:05 +0100 Subject: [PATCH] Renamed roster_jid_from_handle -> roster_barejid_from_handle --- src/command/command.c | 6 +++--- src/xmpp/message.c | 4 ++-- src/xmpp/roster.c | 12 +++++++++++- src/xmpp/xmpp.h | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/command/command.c b/src/command/command.c index 7e0c05a5..3a6853be 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -1973,7 +1973,7 @@ _cmd_msg(gchar **args, struct cmd_help_t help) return TRUE; } else { - char *usr_jid = roster_jid_from_handle(usr); + char *usr_jid = roster_barejid_from_handle(usr); if (msg != NULL) { message_send(msg, usr_jid); ui_outgoing_msg("me", usr_jid, msg); @@ -2105,7 +2105,7 @@ _cmd_status(gchar **args, struct cmd_help_t help) break; case WIN_CONSOLE: if (usr != NULL) { - usr_jid = roster_jid_from_handle(usr); + usr_jid = roster_barejid_from_handle(usr); if (usr_jid == NULL) { usr_jid = usr; } @@ -2178,7 +2178,7 @@ _cmd_info(gchar **args, struct cmd_help_t help) break; case WIN_CONSOLE: if (usr != NULL) { - usr_jid = roster_jid_from_handle(usr); + usr_jid = roster_barejid_from_handle(usr); if (usr_jid == NULL) { usr_jid = usr; } diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 00655bde..8a390039 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -62,8 +62,8 @@ message_send(const char * const msg, const char * const recipient) { const char * jid = NULL; - if (roster_jid_from_handle(recipient) != NULL) { - jid = roster_jid_from_handle(recipient); + if (roster_barejid_from_handle(recipient) != NULL) { + jid = roster_barejid_from_handle(recipient); } else { jid = recipient; } diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c index 4007ee27..e45728c3 100644 --- a/src/xmpp/roster.c +++ b/src/xmpp/roster.c @@ -40,12 +40,22 @@ static int _roster_handle_set(xmpp_conn_t * const conn, static int _roster_handle_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata); +// nicknames static Autocomplete handle_ac; + +// barejids static Autocomplete jid_ac; + +// fulljids static Autocomplete resource_ac; + +// contacts, indexed on barejid static GHashTable *contacts; + +// nickname to jid map static GHashTable *handle_to_jid; +// helper functions static gboolean _key_equals(void *key1, void *key2); static gboolean _datetimes_equal(GDateTime *dt1, GDateTime *dt2); @@ -69,7 +79,7 @@ roster_request(void) } char * -roster_jid_from_handle(const char * const handle) +roster_barejid_from_handle(const char * const handle) { return g_hash_table_lookup(handle_to_jid, handle); } diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 9ac06376..91ee844e 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -142,6 +142,6 @@ gboolean roster_add(const char * const barejid, const char * const name, const char * const subscription, const char * const offline_message, gboolean pending_out); void roster_change_handle(const char * const barejid, const char * const handle); -char * roster_jid_from_handle(const char * const handle); +char * roster_barejid_from_handle(const char * const handle); #endif