mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-27 10:46:21 +00:00
Refactored muc_room_is_active to only take room, rather than full jid
This commit is contained in:
@@ -300,7 +300,7 @@ _bookmark_handle_result(xmpp_conn_t * const conn,
|
||||
|
||||
log_debug("Autojoin %s with nick=%s", jid, name);
|
||||
room_jid = jid_create_from_bare_and_resource(jid, name);
|
||||
if (!muc_room_is_active(room_jid)) {
|
||||
if (!muc_room_is_active(room_jid->barejid)) {
|
||||
presence_join_room(jid, name, NULL);
|
||||
/* TODO: this should be removed after fixing #195 */
|
||||
ui_room_join(jid);
|
||||
|
||||
@@ -247,7 +247,7 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
|
||||
PContact contact;
|
||||
Jid *jidp = jid_create(jid);
|
||||
if (muc_room_is_active(jidp)) {
|
||||
if (muc_room_is_active(jidp->barejid)) {
|
||||
contact = muc_get_participant(jidp->barejid, jidp->resourcepart);
|
||||
} else {
|
||||
contact = roster_get_contact(jidp->barejid);
|
||||
|
||||
@@ -386,7 +386,7 @@ _groupchat_handler(xmpp_conn_t * const conn,
|
||||
}
|
||||
|
||||
// room not active in profanity
|
||||
if (!muc_room_is_active(jid)) {
|
||||
if (!muc_room_is_active(jid->barejid)) {
|
||||
log_error("Message recieved for inactive chat room: %s", jid->str);
|
||||
jid_destroy(jid);
|
||||
return 1;
|
||||
@@ -438,7 +438,7 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
return 1;
|
||||
|
||||
// private message from chat room use full jid (room/nick)
|
||||
} else if (muc_room_is_active(jid)) {
|
||||
} else if (muc_room_is_active(jid->barejid)) {
|
||||
// determine if the notifications happened whilst offline
|
||||
GTimeVal tv_stamp;
|
||||
gboolean delayed = stanza_get_delay(stanza, &tv_stamp);
|
||||
|
||||
@@ -597,7 +597,7 @@ stanza_is_muc_self_presence(xmpp_stanza_t * const stanza,
|
||||
char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
|
||||
if (from != NULL) {
|
||||
Jid *jidp = jid_create(from);
|
||||
if (muc_room_is_active(jidp)) {
|
||||
if (muc_room_is_active(jidp->barejid)) {
|
||||
char *nick = muc_get_room_nick(jidp->barejid);
|
||||
if (g_strcmp0(jidp->resourcepart, nick) == 0) {
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user