diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index f0617ff5..d0e18e70 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -651,7 +651,7 @@ mucwin_role_list_error(const char *const roomjid, const char *const role, const } void -ui_handle_room_role_list(const char *const roomjid, const char *const role, GSList *nicks) +mucwin_handle_role_list(const char *const roomjid, const char *const role, GSList *nicks) { ProfWin *window = (ProfWin*)wins_get_muc(roomjid); if (window) { @@ -680,39 +680,6 @@ ui_handle_room_role_list(const char *const roomjid, const char *const role, GSLi } } -void -ui_handle_room_affiliation_set_error(const char *const roomjid, const char *const jid, const char *const affiliation, - const char *const error) -{ - ProfWin *window = (ProfWin*)wins_get_muc(roomjid); - if (window) { - win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s affiliation for %s: %s", affiliation, jid, error); - } -} - -void -ui_handle_room_role_set_error(const char *const roomjid, const char *const nick, const char *const role, - const char *const error) -{ - ProfWin *window = (ProfWin*)wins_get_muc(roomjid); - if (window) { - win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s role for %s: %s", role, nick, error); - } -} - -void -ui_show_room_info(ProfMucWin *mucwin) -{ - char *role = muc_role_str(mucwin->roomjid); - char *affiliation = muc_affiliation_str(mucwin->roomjid); - - ProfWin *window = (ProfWin*) mucwin; - win_vprint(window, '!', 0, NULL, 0, 0, "", "Room: %s", mucwin->roomjid); - win_vprint(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation); - win_vprint(window, '!', 0, NULL, 0, 0, "", "Role: %s", role); - win_print(window, '-', 0, NULL, 0, 0, "", ""); -} - void ui_show_room_role_list(ProfMucWin *mucwin, muc_role_t role) { @@ -767,6 +734,39 @@ ui_show_room_role_list(ProfMucWin *mucwin, muc_role_t role) } } +void +ui_handle_room_affiliation_set_error(const char *const roomjid, const char *const jid, const char *const affiliation, + const char *const error) +{ + ProfWin *window = (ProfWin*)wins_get_muc(roomjid); + if (window) { + win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s affiliation for %s: %s", affiliation, jid, error); + } +} + +void +ui_handle_room_role_set_error(const char *const roomjid, const char *const nick, const char *const role, + const char *const error) +{ + ProfWin *window = (ProfWin*)wins_get_muc(roomjid); + if (window) { + win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s role for %s: %s", role, nick, error); + } +} + +void +ui_show_room_info(ProfMucWin *mucwin) +{ + char *role = muc_role_str(mucwin->roomjid); + char *affiliation = muc_affiliation_str(mucwin->roomjid); + + ProfWin *window = (ProfWin*) mucwin; + win_vprint(window, '!', 0, NULL, 0, 0, "", "Room: %s", mucwin->roomjid); + win_vprint(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation); + win_vprint(window, '!', 0, NULL, 0, 0, "", "Role: %s", role); + win_print(window, '-', 0, NULL, 0, 0, "", ""); +} + void ui_room_update_occupants(const char *const roomjid) { diff --git a/src/ui/ui.h b/src/ui/ui.h index cde39c01..adc6db0b 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -163,7 +163,7 @@ void ui_handle_room_affiliation_set_error(const char *const roomjid, const char void ui_handle_room_role_set_error(const char *const roomjid, const char *const nick, const char *const role, const char *const error); void mucwin_role_list_error(const char *const roomjid, const char *const role, const char *const error); -void ui_handle_room_role_list(const char *const roomjid, const char *const role, GSList *nicks); +void mucwin_handle_role_list(const char *const roomjid, const char *const role, GSList *nicks); void mucwin_kick_error(const char *const roomjid, const char *const nick, const char *const error); void ui_show_form(ProfMucConfWin *confwin); void ui_show_form_field(ProfWin *window, DataForm *form, char *tag); diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index d5f9c554..55645783 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -1412,7 +1412,7 @@ _room_role_list_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const sta } } - ui_handle_room_role_list(from, role, nicks); + mucwin_handle_role_list(from, role, nicks); free(role); g_slist_free(nicks); diff --git a/tests/unittests/ui/stub_ui.c b/tests/unittests/ui/stub_ui.c index c3b263df..55685dab 100644 --- a/tests/unittests/ui/stub_ui.c +++ b/tests/unittests/ui/stub_ui.c @@ -283,7 +283,7 @@ void ui_handle_room_affiliation_set_error(const char * const roomjid, const char void ui_handle_room_role_set_error(const char * const roomjid, const char * const nick, const char * const role, const char * const error) {} void mucwin_role_list_error(const char * const roomjid, const char * const role, const char * const error) {} -void ui_handle_room_role_list(const char * const roomjid, const char * const role, GSList *nicks) {} +void mucwin_handle_role_list(const char * const roomjid, const char * const role, GSList *nicks) {} void mucwin_kick_error(const char * const roomjid, const char * const nick, const char * const error) {} void ui_show_form(ProfMucConfWin *confwin) {} void ui_show_form_field(ProfWin *window, DataForm *form, char *tag) {}