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

mucwin_affiliation_set_error takes ProfMucWin

This commit is contained in:
James Booth 2015-11-02 00:51:12 +00:00
parent c9db9257ae
commit 982bc8e066
4 changed files with 13 additions and 10 deletions

View File

@ -715,13 +715,13 @@ mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role)
}
void
mucwin_affiliation_set_error(const char *const roomjid, const char *const jid, const char *const affiliation,
mucwin_affiliation_set_error(ProfMucWin *mucwin, 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);
}
assert(mucwin != NULL);
ProfWin *window = (ProfWin*)mucwin;
win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s affiliation for %s: %s", affiliation, jid, error);
}
void

View File

@ -199,8 +199,8 @@ 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(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_affiliation_set_error(ProfMucWin *mucwin, 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,
const char *const error);
void mucwin_role_list_error(ProfMucWin *mucwin, const char *const role, const char *const error);

View File

@ -1284,7 +1284,10 @@ _room_affiliation_set_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *con
if (g_strcmp0(type, STANZA_TYPE_ERROR) == 0) {
char *error_message = stanza_get_error_message(stanza);
log_debug("Error setting affiliation %s list for room %s, user %s: %s", affiliation_set->privilege, from, affiliation_set->item, error_message);
mucwin_affiliation_set_error(from, affiliation_set->item, affiliation_set->privilege, error_message);
ProfMucWin *mucwin = wins_get_muc(from);
if (mucwin) {
mucwin_affiliation_set_error(mucwin, affiliation_set->item, affiliation_set->privilege, error_message);
}
free(error_message);
}

View File

@ -273,8 +273,8 @@ 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(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_affiliation_set_error(ProfMucWin *mucwin, 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,
const char * const error) {}
void mucwin_role_list_error(ProfMucWin *mucwin, const char * const role, const char * const error) {}