diff options
author | James Booth <boothj5@gmail.com> | 2013-01-16 01:00:06 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-01-16 01:00:06 +0000 |
commit | af6779401ad9434cc27ea4d10af62332ffcfe86f (patch) | |
tree | 6c5b004e47d34bf55ed5ba9477804d28448f49d4 | |
parent | 02a71e251095689cde374da4e670b746a987ddeb (diff) | |
download | profani-tty-af6779401ad9434cc27ea4d10af62332ffcfe86f.tar.gz |
Show message in chat room when nickname conflict
-rw-r--r-- | src/command.c | 2 | ||||
-rw-r--r-- | 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); |