mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
mucwin_role_change takes ProfMucWin
This commit is contained in:
parent
2be3b7d9a2
commit
e547ae0bcc
@ -592,7 +592,10 @@ sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean c
|
|||||||
|
|
||||||
// role changed
|
// role changed
|
||||||
} else if (g_strcmp0(role, old_role) != 0) {
|
} else if (g_strcmp0(role, old_role) != 0) {
|
||||||
mucwin_role_change(room, role, actor, reason);
|
ProfMucWin *mucwin = wins_get_muc(room);
|
||||||
|
if (mucwin) {
|
||||||
|
mucwin_role_change(mucwin, role, actor, reason);
|
||||||
|
}
|
||||||
|
|
||||||
// affiliation changed
|
// affiliation changed
|
||||||
} else if (g_strcmp0(affiliation, old_affiliation) != 0) {
|
} else if (g_strcmp0(affiliation, old_affiliation) != 0) {
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "ui/win_types.h"
|
#include "ui/win_types.h"
|
||||||
#include "window_list.h"
|
#include "window_list.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -39,10 +41,12 @@
|
|||||||
#include "ui/window.h"
|
#include "ui/window.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
mucwin_role_change(const char *const roomjid, const char *const role, const char *const actor,
|
mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const actor,
|
||||||
const char *const reason)
|
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, "", "Your role has been changed to: %s", role);
|
win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Your role has been changed to: %s", role);
|
||||||
if (actor) {
|
if (actor) {
|
||||||
win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
|
win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
|
||||||
|
@ -161,8 +161,7 @@ void chatwin_otr_smp_event(ProfChatWin *chatwin, prof_otr_smp_event_t event, voi
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// MUC window
|
// MUC window
|
||||||
void mucwin_role_change(const char *const roomjid, const char *const role, const char *const actor,
|
void mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const actor, const char *const reason);
|
||||||
const char *const reason);
|
|
||||||
void mucwin_affiliation_change(const char *const roomjid, const char *const affiliation, const char *const actor,
|
void mucwin_affiliation_change(const char *const roomjid, const char *const affiliation, const char *const actor,
|
||||||
const char *const reason);
|
const char *const reason);
|
||||||
void mucwin_role_and_affiliation_change(const char *const roomjid, const char *const role,
|
void mucwin_role_and_affiliation_change(const char *const roomjid, const char *const role,
|
||||||
|
@ -191,7 +191,7 @@ void ui_outgoing_private_msg(ProfPrivateWin *privwin, const char * const message
|
|||||||
void ui_room_join(const char * const roomjid, gboolean focus) {}
|
void ui_room_join(const char * const roomjid, gboolean focus) {}
|
||||||
void ui_switch_to_room(const char * const roomjid) {}
|
void ui_switch_to_room(const char * const roomjid) {}
|
||||||
|
|
||||||
void mucwin_role_change(const char * const roomjid, const char * const role, const char * const actor,
|
void mucwin_role_change(ProfMucWin *mucwin, const char * const role, const char * const actor,
|
||||||
const char * const reason) {}
|
const char * const reason) {}
|
||||||
void mucwin_affiliation_change(const char * const roomjid, const char * const affiliation, const char * const actor,
|
void mucwin_affiliation_change(const char * const roomjid, const char * const affiliation, const char * const actor,
|
||||||
const char * const reason) {}
|
const char * const reason) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user