1
0
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

mucwin_occupant_role_and_affiliation_change takes ProfMucWin

This commit is contained in:
James Booth 2015-11-01 23:15:49 +00:00
parent 799c064dff
commit ed9585376e
4 changed files with 10 additions and 5 deletions

View File

@ -660,7 +660,10 @@ sv_ev_muc_occupant_online(const char *const room, const char *const nick, const
if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) {
// both changed
if ((g_strcmp0(role, old_role) != 0) && (g_strcmp0(affiliation, old_affiliation) != 0)) {
mucwin_occupant_role_and_affiliation_change(room, nick, role, affiliation, actor, reason);
ProfMucWin *mucwin = wins_get_muc(room);
if (mucwin) {
mucwin_occupant_role_and_affiliation_change(mucwin, nick, role, affiliation, actor, reason);
}
// role changed
} else if (g_strcmp0(role, old_role) != 0) {

View File

@ -126,10 +126,12 @@ mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const nick, c
}
void
mucwin_occupant_role_and_affiliation_change(const char *const roomjid, const char *const nick, const char *const role,
mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char *const nick, const char *const role,
const char *const affiliation, const char *const actor, const char *const reason)
{
ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
assert(mucwin != NULL);
ProfWin *window = (ProfWin*)mucwin;
win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role and affiliation have been changed, role: %s, affiliation: %s", nick, role, affiliation);
if (actor) {
win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);

View File

@ -170,7 +170,7 @@ void mucwin_occupant_role_change(ProfMucWin *mucwin, const char *const nick, con
const char *const actor, const char *const reason);
void mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const nick,
const char *const affiliation, const char *const actor, const char *const reason);
void mucwin_occupant_role_and_affiliation_change(const char *const roomjid, const char *const nick,
void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char *const nick,
const char *const role, const char *const affiliation, const char *const actor, const char *const reason);
void mucwin_roster(const char *const roomjid, GList *occupants, const char *const presence);
void mucwin_history(const char *const roomjid, const char *const nick, GDateTime *timestamp,

View File

@ -201,7 +201,7 @@ void mucwin_occupant_role_change(ProfMucWin *mucwin, const char * const nick, co
const char * const actor, const char * const reason) {}
void mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char * const nick, const char * const affiliation,
const char * const actor, const char * const reason) {}
void mucwin_occupant_role_and_affiliation_change(const char * const roomjid, const char * const nick, const char * const role,
void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char * const nick, const char * const role,
const char * const affiliation, const char * const actor, const char * const reason) {}
void mucwin_roster(const char * const roomjid, GList *occupants, const char * const presence) {}
void mucwin_history(const char * const roomjid, const char * const nick,