mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Refactor handle_muc_occupant_online
This commit is contained in:
parent
d6a4af9992
commit
d8eb97eec8
@ -719,26 +719,27 @@ void
|
||||
handle_muc_occupant_online(const char * const room, const char * const nick, const char * const jid,
|
||||
const char * const role, const char * const affiliation, const char * const show, const char * const status)
|
||||
{
|
||||
if (!muc_roster_complete(room)) {
|
||||
muc_roster_add(room, nick, jid, role, affiliation, show, status);
|
||||
} else {
|
||||
char *old_nick = muc_roster_nick_change_complete(room, nick);
|
||||
gboolean updated = muc_roster_add(room, nick, jid, role, affiliation, show, status);
|
||||
|
||||
if (!muc_roster_complete(room)) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *old_nick = muc_roster_nick_change_complete(room, nick);
|
||||
if (old_nick) {
|
||||
muc_roster_add(room, nick, jid, role, affiliation, show, status);
|
||||
ui_room_member_nick_change(room, old_nick, nick);
|
||||
free(old_nick);
|
||||
} else {
|
||||
if (!muc_roster_contains_nick(room, nick)) {
|
||||
muc_roster_add(room, nick, jid, role, affiliation, show, status);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!muc_roster_contains_nick(room, nick)) {
|
||||
char *muc_status_pref = prefs_get_string(PREF_STATUSES_MUC);
|
||||
if (g_strcmp0(muc_status_pref, "none") != 0) {
|
||||
ui_room_member_online(room, nick, show, status);
|
||||
}
|
||||
prefs_free_string(muc_status_pref);
|
||||
} else {
|
||||
gboolean updated = muc_roster_add(room, nick, jid, role, affiliation, show, status);
|
||||
return;
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
char *muc_status_pref = prefs_get_string(PREF_STATUSES_MUC);
|
||||
@ -748,6 +749,3 @@ handle_muc_occupant_online(const char * const room, const char * const nick, con
|
||||
prefs_free_string(muc_status_pref);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user