From 7c85f0fcb20254867e4ad2f96d4f336523c09db6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 7 Nov 2012 00:02:43 +0000 Subject: [PATCH] room_chat: rename room_is_active --- src/jabber.c | 11 ++++------- src/room_chat.c | 2 +- src/room_chat.h | 2 +- src/windows.c | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/jabber.c b/src/jabber.c index a139dedc..b3a1b9af 100644 --- a/src/jabber.c +++ b/src/jabber.c @@ -375,14 +375,11 @@ static int _message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata) { - char *type = NULL; - char *from = NULL; - - type = xmpp_stanza_get_attribute(stanza, "type"); - from = xmpp_stanza_get_attribute(stanza, "from"); + gchar *type = xmpp_stanza_get_attribute(stanza, "type"); + gchar *from = xmpp_stanza_get_attribute(stanza, "from"); // handle groupchat messages - if (room_jid_is_room_chat(from)) { + if (room_is_active(from)) { xmpp_stanza_t *delay = xmpp_stanza_get_child_by_name(stanza, "delay"); // handle chat room history @@ -633,7 +630,7 @@ _presence_handler(xmpp_conn_t * const conn, char *from = xmpp_stanza_get_attribute(stanza, "from"); - if (room_jid_is_room_chat(from)) { + if (room_is_active(from)) { char **tokens = g_strsplit(from, "/", 0); char *room_jid = tokens[0]; char *nick = tokens[1]; diff --git a/src/room_chat.c b/src/room_chat.c index 5031d8ad..dd8ae91a 100644 --- a/src/room_chat.c +++ b/src/room_chat.c @@ -56,7 +56,7 @@ room_leave(const char * const jid) } gboolean -room_jid_is_room_chat(const char * const jid) +room_is_active(const char * const jid) { char **tokens = g_strsplit(jid, "/", 0); char *jid_part = tokens[0]; diff --git a/src/room_chat.h b/src/room_chat.h index 04f6300e..41f93c62 100644 --- a/src/room_chat.h +++ b/src/room_chat.h @@ -24,7 +24,7 @@ void room_join(const char * const jid, const char * const nick); void room_leave(const char * const jid); -gboolean room_jid_is_room_chat(const char * const jid); +gboolean room_is_active(const char * const jid); char * room_get_nick_for_room(const char * const jid); gboolean room_parse_room_jid(const char * const room_jid, char **room, char **nick); diff --git a/src/windows.c b/src/windows.c index bcbff5dd..1f49c540 100644 --- a/src/windows.c +++ b/src/windows.c @@ -200,7 +200,7 @@ win_in_chat(void) int win_in_groupchat(void) { - if (room_jid_is_room_chat(_wins[_curr_prof_win].from)) { + if (room_is_active(_wins[_curr_prof_win].from)) { return 1; } else { return 0;