Changed error message when couldn't join room

This commit is contained in:
James Booth
2014-01-26 22:19:22 +00:00
parent 292ae567aa
commit 50f1a5ecc0
3 changed files with 20 additions and 9 deletions

View File

@@ -360,21 +360,31 @@ _ui_handle_recipient_not_found(const char * const from)
ProfWin *win = wins_get_by_recipient(from);
GString *msg = g_string_new("");
// Message sent to chat room which hasn't been entered yet
if (win->type == WIN_MUC) {
// no window for intended recipient, show message in current and console
if (win == NULL) {
g_string_printf(msg, "Recipient %s not found at server.", from);
cons_show_error(msg->str);
win = wins_get_current();
if (win->type != WIN_CONSOLE) {
win_print_line(win, '!', COLOUR_ERROR, msg->str);
}
// intended recipient was invalid chat room
} else if (win->type == WIN_MUC) {
g_string_printf(msg, "You have not joined %s.", from);
cons_show_error(msg->str);
win_print_line(win, '!', COLOUR_ERROR, msg->str);
// unknown chat recipient
} else {
if (prefs_get_boolean(PREF_STATES)) {
if (prefs_get_boolean(PREF_STATES) && chat_session_exists(from)) {
chat_session_set_recipient_supports(from, FALSE);
}
g_string_printf(msg, "Recipient %s not found at server.", from);
cons_show_error(msg->str);
win_print_line(win, '!', COLOUR_ERROR, msg->str);
}
cons_show_error(msg->str);
win_print_line(win, '!', COLOUR_ERROR, msg->str);
wins_refresh_current();
g_string_free(msg, TRUE);