From 3dffc1d9ff5b7c334551282499dc06fbb1f8f80e Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 6 Oct 2013 00:26:03 +0100 Subject: Moved muc error handling to profanity.c --- src/profanity.c | 9 +++++++++ src/ui/core.c | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/profanity.c b/src/profanity.c index c2de40a4..4c621ffa 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -188,6 +188,15 @@ void prof_handle_error_message(const char *from, const char *err_msg) { ui_handle_error_message(from, err_msg); + + if (g_strcmp0(err_msg, "conflict") == 0) { + // remove the room from muc + Jid *room_jid = jid_create(from); + if (!muc_get_roster_received(room_jid->barejid)) { + muc_leave_room(room_jid->barejid); + } + jid_destroy(room_jid); + } } void diff --git a/src/ui/core.c b/src/ui/core.c index be1afd03..2cb133b6 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -414,13 +414,6 @@ ui_handle_error_message(const char * const from, const char * const err_msg) } else { cons_show_error("Error received from server: %s", err_msg); } - // remove the room from muc - Jid *room_jid = jid_create(from); - if (!muc_get_roster_received(room_jid->barejid)) { - muc_leave_room(room_jid->barejid); - } - jid_destroy(room_jid); - } else { cons_show_error("Error received from server: %s", err_msg); } -- cgit 1.4.1-2-gfad0