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

room_chat: rename room_is_active

This commit is contained in:
James Booth 2012-11-07 00:02:43 +00:00
parent 3436a2245d
commit 7c85f0fcb2
4 changed files with 7 additions and 10 deletions

View File

@ -375,14 +375,11 @@ static int
_message_handler(xmpp_conn_t * const conn, _message_handler(xmpp_conn_t * const conn,
xmpp_stanza_t * const stanza, void * const userdata) xmpp_stanza_t * const stanza, void * const userdata)
{ {
char *type = NULL; gchar *type = xmpp_stanza_get_attribute(stanza, "type");
char *from = NULL; gchar *from = xmpp_stanza_get_attribute(stanza, "from");
type = xmpp_stanza_get_attribute(stanza, "type");
from = xmpp_stanza_get_attribute(stanza, "from");
// handle groupchat messages // 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"); xmpp_stanza_t *delay = xmpp_stanza_get_child_by_name(stanza, "delay");
// handle chat room history // handle chat room history
@ -633,7 +630,7 @@ _presence_handler(xmpp_conn_t * const conn,
char *from = xmpp_stanza_get_attribute(stanza, "from"); 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 **tokens = g_strsplit(from, "/", 0);
char *room_jid = tokens[0]; char *room_jid = tokens[0];
char *nick = tokens[1]; char *nick = tokens[1];

View File

@ -56,7 +56,7 @@ room_leave(const char * const jid)
} }
gboolean gboolean
room_jid_is_room_chat(const char * const jid) room_is_active(const char * const jid)
{ {
char **tokens = g_strsplit(jid, "/", 0); char **tokens = g_strsplit(jid, "/", 0);
char *jid_part = tokens[0]; char *jid_part = tokens[0];

View File

@ -24,7 +24,7 @@
void room_join(const char * const jid, const char * const nick); void room_join(const char * const jid, const char * const nick);
void room_leave(const char * const jid); 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); char * room_get_nick_for_room(const char * const jid);
gboolean room_parse_room_jid(const char * const room_jid, char **room, gboolean room_parse_room_jid(const char * const room_jid, char **room,
char **nick); char **nick);

View File

@ -200,7 +200,7 @@ win_in_chat(void)
int int
win_in_groupchat(void) 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; return 1;
} else { } else {
return 0; return 0;