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:
parent
986741dea8
commit
0592c7f9e9
@ -597,7 +597,9 @@ sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean c
|
|||||||
// room configuration required
|
// room configuration required
|
||||||
if (config_required) {
|
if (config_required) {
|
||||||
muc_set_requires_config(room, TRUE);
|
muc_set_requires_config(room, TRUE);
|
||||||
mucwin_requires_config(room);
|
if (mucwin) {
|
||||||
|
mucwin_requires_config(mucwin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for change in role/affiliation
|
// check for change in role/affiliation
|
||||||
|
@ -434,37 +434,31 @@ mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const mes
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mucwin_requires_config(const char *const roomjid)
|
mucwin_requires_config(ProfMucWin *mucwin)
|
||||||
{
|
{
|
||||||
ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
|
assert(mucwin != NULL);
|
||||||
if (window == NULL) {
|
|
||||||
log_error("Received room config request, but no window open for %s.", roomjid);
|
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 {
|
} else {
|
||||||
int num = wins_get_num(window);
|
status_bar_new(num);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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_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_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_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_info(ProfMucWin *mucwin);
|
||||||
void mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role);
|
void mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role);
|
||||||
void mucwin_show_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation);
|
void mucwin_show_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation);
|
||||||
|
@ -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_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_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_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 ui_room_destroy(const char * const roomjid) {}
|
||||||
void mucwin_info(ProfMucWin *mucwin) {}
|
void mucwin_info(ProfMucWin *mucwin) {}
|
||||||
void mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role) {}
|
void mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user