pidgin.mxit: cb648f13: The MultMX server now always sends "You ...
andrew.victor at mxit.com
andrew.victor at mxit.com
Mon Mar 21 17:31:02 EDT 2011
----------------------------------------------------------------------
Revision: cb648f13e19ca0b7edb682842239c3017a2f1fcc
Parent: 78a9bf10173186c8c8775541e984f77ee05e2f22
Author: andrew.victor at mxit.com
Date: 03/21/11 16:52:40
Branch: im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/cb648f13e19ca0b7edb682842239c3017a2f1fcc
Changelog:
The MultMX server now always sends "You have been kicked." when you are
kicked from a room. Therefore comparing the nickname being kicked with our
original nickname is no longer necessary.
Changes against parent 78a9bf10173186c8c8775541e984f77ee05e2f22
patched libpurple/protocols/mxit/multimx.c
-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/multimx.c e049ee7b107beaa8c6a5c4a5a5e187a00991abcf
+++ libpurple/protocols/mxit/multimx.c 2385277f739ac1e40e9136019956611fd8b3ac5c
@@ -239,16 +239,31 @@ static void member_kicked(struct MXitSes
return;
}
- /* who was kicked? - compare to our original nickname */
- if (purple_utf8_strcasecmp(nickname, multimx->nickname) == 0)
- {
- /* you were kicked */
- purple_conv_chat_write(PURPLE_CONV_CHAT(convo), "MXit", _("You have been kicked from this MultiMX."), PURPLE_MESSAGE_SYSTEM, time(NULL));
- purple_conv_chat_clear_users(PURPLE_CONV_CHAT(convo));
- serv_got_chat_left(session->con, multimx->chatid);
+ purple_conv_chat_remove_user(PURPLE_CONV_CHAT(convo), nickname, _("was kicked"));
+}
+
+
+/*------------------------------------------------------------------------
+ * You were kicked from the GroupChat.
+ *
+ * @param session The MXit session object
+ * @param multimx The MultiMX room object
+ */
+static void you_kicked(struct MXitSession* session, struct multimx* multimx)
+{
+ PurpleConversation *convo;
+
+ purple_debug_info(MXIT_PLUGIN_ID, "you_kicked\n");
+
+ convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, multimx->roomname, session->acc);
+ if (convo == NULL) {
+ purple_debug_error(MXIT_PLUGIN_ID, "Conversation '%s' not found\n", multimx->roomname);
+ return;
}
- else
- purple_conv_chat_remove_user(PURPLE_CONV_CHAT(convo), nickname, _("was kicked"));
+
+ purple_conv_chat_write(PURPLE_CONV_CHAT(convo), "MXit", _("You have been kicked from this MultiMX."), PURPLE_MESSAGE_SYSTEM, time(NULL));
+ purple_conv_chat_clear_users(PURPLE_CONV_CHAT(convo));
+ serv_got_chat_left(session->con, multimx->chatid);
}
@@ -421,6 +436,11 @@ void multimx_message_received(struct RXM
member_kicked(mx->session, multimx, msg);
mx->processed = TRUE;
}
+ else if (strcmp(msg, "You have been kicked.") == 0) {
+ /* You have been kicked */
+ you_kicked(mx->session, multimx);
+ mx->processed = TRUE;
+ }
else if (g_str_has_prefix(msg, "The following users are in this MultiMx:") == TRUE) {
member_update(mx->session, multimx, msg + strlen("The following users are in this MultiMx:") + 1);
mx->processed = TRUE;
More information about the Commits
mailing list