1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

mucwin_occupant_nick_change takes ProfMucWin

This commit is contained in:
James Booth 2015-11-02 00:16:01 +00:00
parent b3150ef8e1
commit 42643391a4
4 changed files with 11 additions and 12 deletions

View File

@ -637,7 +637,10 @@ sv_ev_muc_occupant_online(const char *const room, const char *const nick, const
// handle nickname change
char *old_nick = muc_roster_nick_change_complete(room, nick);
if (old_nick) {
mucwin_occupant_nick_change(room, old_nick, nick);
ProfMucWin *mucwin = wins_get_muc(room);
if (mucwin) {
mucwin_occupant_nick_change(mucwin, old_nick, nick);
}
free(old_nick);
occupantswin_occupants(room);
return;

View File

@ -314,15 +314,12 @@ mucwin_occupant_presence(ProfMucWin *mucwin, const char *const nick,
}
void
mucwin_occupant_nick_change(const char *const roomjid,
const char *const old_nick, const char *const nick)
mucwin_occupant_nick_change(ProfMucWin *mucwin, const char *const old_nick, const char *const nick)
{
ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window == NULL) {
log_error("Received nick change for room participant %s, but no window open for %s.", old_nick, roomjid);
} else {
win_vprint(window, '!', 0, NULL, 0, THEME_THEM, "", "** %s is now known as %s", old_nick, nick);
}
assert(mucwin != NULL);
ProfWin *window = (ProfWin*)mucwin;
win_vprint(window, '!', 0, NULL, 0, THEME_THEM, "", "** %s is now known as %s", old_nick, nick);
}
void

View File

@ -191,7 +191,7 @@ void mucwin_broadcast(const char *const roomjid, const char *const message);
void mucwin_occupant_offline(ProfMucWin *mucwin, const char *const nick);
void mucwin_occupant_online(ProfMucWin *mucwin, const char *const nick, const char *const roles,
const char *const affiliation, const char *const show, const char *const status);
void mucwin_occupant_nick_change(const char *const roomjid, const char *const old_nick, const char *const nick);
void mucwin_occupant_nick_change(ProfMucWin *mucwin, const char *const old_nick, const char *const nick);
void mucwin_nick_change(const char *const roomjid, const char *const nick);
void mucwin_occupant_presence(ProfMucWin *mucwin, const char *const nick, const char *const show,
const char *const status);

View File

@ -230,8 +230,7 @@ void mucwin_broadcast(const char * const roomjid,
void mucwin_occupant_offline(ProfMucWin *mucwin, const char * const nick) {}
void mucwin_occupant_online(ProfMucWin *mucwin, const char * const nick, const char * const roles,
const char * const affiliation, const char * const show, const char * const status) {}
void mucwin_occupant_nick_change(const char * const roomjid,
const char * const old_nick, const char * const nick) {}
void mucwin_occupant_nick_change(ProfMucWin *mucwin, const char * const old_nick, const char * const nick) {}
void mucwin_nick_change(const char * const roomjid, const char * const nick) {}
void mucwin_occupant_presence(ProfMucWin *mucwin, const char * const nick, const char * const show,
const char * const status) {}