1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

mucwin_requires_config takes ProfMucWin

This commit is contained in:
James Booth 2015-11-02 00:26:56 +00:00
parent 986741dea8
commit 0592c7f9e9
4 changed files with 28 additions and 32 deletions

View File

@ -597,7 +597,9 @@ sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean c
// room configuration required
if (config_required) {
muc_set_requires_config(room, TRUE);
mucwin_requires_config(room);
if (mucwin) {
mucwin_requires_config(mucwin);
}
}
// check for change in role/affiliation

View File

@ -434,37 +434,31 @@ mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const mes
}
void
mucwin_requires_config(const char *const roomjid)
mucwin_requires_config(ProfMucWin *mucwin)
{
ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window == NULL) {
log_error("Received room config request, but no window open for %s.", roomjid);
assert(mucwin != NULL);
ProfWin *window = (ProfWin*)mucwin;
int num = wins_get_num(window);
int ui_index = num;
if (ui_index == 10) {
ui_index = 0;
}
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room locked, requires configuration.");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room accept' to accept the defaults");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room destroy' to cancel and destroy the room");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room config' to edit the room configuration");
win_print(window, '-', 0, NULL, 0, 0, "", "");
// currently in groupchat window
if (wins_is_current(window)) {
status_bar_active(num);
// not currently on groupchat window
} else {
int num = wins_get_num(window);
int ui_index = num;
if (ui_index == 10) {
ui_index = 0;
}
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "",
"Room locked, requires configuration.");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "",
"Use '/room accept' to accept the defaults");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "",
"Use '/room destroy' to cancel and destroy the room");
win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "",
"Use '/room config' to edit the room configuration");
win_print(window, '-', 0, NULL, 0, 0, "", "");
// currently in groupchat window
if (wins_is_current(window)) {
status_bar_active(num);
// not currently on groupchat window
} else {
status_bar_new(num);
}
status_bar_new(num);
}
}

View File

@ -176,7 +176,7 @@ void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char *const prese
void mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message);
void mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const message);
void mucwin_subject(const char *const roomjid, const char *const nick, const char *const subject);
void mucwin_requires_config(const char *const roomjid);
void mucwin_requires_config(ProfMucWin *mucwin);
void mucwin_info(ProfMucWin *mucwin);
void mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role);
void mucwin_show_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation);

View File

@ -207,7 +207,7 @@ void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char * const pres
void mucwin_history(ProfMucWin *mucwin, const char * const nick, GDateTime *timestamp, const char * const message) {}
void mucwin_message(ProfMucWin *mucwin, const char * const nick, const char * const message) {}
void mucwin_subject(const char * const roomjid, const char * const nick, const char * const subject) {}
void mucwin_requires_config(const char * const roomjid) {}
void mucwin_requires_config(ProfMucWin *mucwin) {}
void ui_room_destroy(const char * const roomjid) {}
void mucwin_info(ProfMucWin *mucwin) {}
void mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role) {}