1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Moved muc error handling to profanity.c

This commit is contained in:
James Booth 2013-10-06 00:26:03 +01:00
parent 710c49b6b8
commit 3dffc1d9ff
2 changed files with 9 additions and 7 deletions

View File

@ -188,6 +188,15 @@ void
prof_handle_error_message(const char *from, const char *err_msg) prof_handle_error_message(const char *from, const char *err_msg)
{ {
ui_handle_error_message(from, 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 void

View File

@ -414,13 +414,6 @@ ui_handle_error_message(const char * const from, const char * const err_msg)
} else { } else {
cons_show_error("Error received from server: %s", err_msg); 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 { } else {
cons_show_error("Error received from server: %s", err_msg); cons_show_error("Error received from server: %s", err_msg);
} }