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

mucwin_handle_affiliation_list takes ProfMucWin

This commit is contained in:
James Booth 2015-11-02 00:40:23 +00:00
parent d81dbdb233
commit 3341e8c202
4 changed files with 21 additions and 18 deletions

View File

@ -537,23 +537,23 @@ mucwin_affiliation_list_error(ProfMucWin *mucwin, const char *const affiliation,
}
void
mucwin_handle_affiliation_list(const char *const roomjid, const char *const affiliation, GSList *jids)
mucwin_handle_affiliation_list(ProfMucWin *mucwin, const char *const affiliation, GSList *jids)
{
ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) {
if (jids) {
win_vprint(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation);
GSList *curr_jid = jids;
while (curr_jid) {
char *jid = curr_jid->data;
win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", jid);
curr_jid = g_slist_next(curr_jid);
}
win_print(window, '!', 0, NULL, 0, 0, "", "");
} else {
win_vprint(window, '!', 0, NULL, 0, 0, "", "No users found with affiliation: %s", affiliation);
win_print(window, '!', 0, NULL, 0, 0, "", "");
assert(mucwin != NULL);
ProfWin *window = (ProfWin*)mucwin;
if (jids) {
win_vprint(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation);
GSList *curr_jid = jids;
while (curr_jid) {
char *jid = curr_jid->data;
win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", jid);
curr_jid = g_slist_next(curr_jid);
}
win_print(window, '!', 0, NULL, 0, 0, "", "");
} else {
win_vprint(window, '!', 0, NULL, 0, 0, "", "No users found with affiliation: %s", affiliation);
win_print(window, '!', 0, NULL, 0, 0, "", "");
}
}

View File

@ -198,7 +198,7 @@ void mucwin_update_occupants(const char *const roomjid);
void mucwin_show_occupants(const char *const roomjid);
void mucwin_hide_occupants(const char *const roomjid);
void mucwin_affiliation_list_error(ProfMucWin *mucwin, const char *const affiliation, const char *const error);
void mucwin_handle_affiliation_list(const char *const roomjid, const char *const affiliation, GSList *jids);
void mucwin_handle_affiliation_list(ProfMucWin *mucwin, const char *const affiliation, GSList *jids);
void mucwin_affiliation_set_error(const char *const roomjid, const char *const jid,
const char *const affiliation, const char *const error);
void mucwin_role_set_error(const char *const roomjid, const char *const nick, const char *const role,

View File

@ -1369,7 +1369,10 @@ _room_affiliation_list_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *co
}
muc_jid_autocomplete_add_all(from, jids);
mucwin_handle_affiliation_list(from, affiliation, jids);
ProfMucWin *mucwin = wins_get_muc(from);
if (mucwin) {
mucwin_handle_affiliation_list(mucwin, affiliation, jids);
}
free(affiliation);
g_slist_free(jids);

View File

@ -272,7 +272,7 @@ void ui_handle_room_configuration_form_error(const char * const roomjid, const c
void ui_handle_room_config_submit_result(const char * const roomjid) {}
void ui_handle_room_config_submit_result_error(const char * const roomjid, const char * const message) {}
void mucwin_affiliation_list_error(ProfMucWin *mucwin, const char * const affiliation, const char * const error) {}
void mucwin_handle_affiliation_list(const char * const roomjid, const char * const affiliation, GSList *jids) {}
void mucwin_handle_affiliation_list(ProfMucWin *mucwin, const char * const affiliation, GSList *jids) {}
void mucwin_affiliation_set_error(const char * const roomjid, const char * const jid,
const char * const affiliation, const char * const error) {}
void mucwin_role_set_error(const char * const roomjid, const char * const nick, const char * const role,