From af6779401ad9434cc27ea4d10af62332ffcfe86f Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 16 Jan 2013 01:00:06 +0000 Subject: [PATCH] Show message in chat room when nickname conflict --- src/command.c | 2 +- src/profanity.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/command.c b/src/command.c index 421a5585..ba69da15 100644 --- a/src/command.c +++ b/src/command.c @@ -1624,7 +1624,7 @@ _cmd_msg(gchar **args, struct cmd_help_t help) g_string_free(full_jid, TRUE); } else { - cons_show("No such nick \"%s\" in room %s.", usr, room_name); + win_current_show("No such participant \"%s\" in room.", usr); } return TRUE; diff --git a/src/profanity.c b/src/profanity.c index 8e214421..91d8be78 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -152,10 +152,16 @@ prof_handle_delayed_message(char *from, char *message, GTimeVal tv_stamp, void prof_handle_error_message(const char *from, const char *err_msg) { - if (err_msg != NULL) { - cons_bad_show("Error received from server: %s", err_msg); + if (err_msg == NULL) { + cons_bad_show("Unknown error received from service."); + } else if (strcmp(err_msg, "conflict") == 0) { + if (win_current_is_groupchat()) { + win_current_show("Nickname already in use."); + } else { + cons_bad_show("Error received from server: %s", err_msg); + } } else { - cons_bad_show("Unknown error received from server."); + cons_bad_show("Error received from server: %s", err_msg); } win_show_error_msg(from, err_msg);