libpurple/protocols/mxit/multimx.c

branch
soc.2013.gobjectification.plugins
changeset 37148
50f361d39a1e
parent 37103
cdc96a002b33
parent 36084
2172bd6dad3e
child 37426
6fd4989b77e4
--- a/libpurple/protocols/mxit/multimx.c	Tue May 20 10:59:21 2014 +0530
+++ b/libpurple/protocols/mxit/multimx.c	Sat May 24 02:32:01 2014 +0530
@@ -226,7 +226,8 @@
 {
 	purple_debug_info(MXIT_PLUGIN_ID, "you_kicked\n");
 
-	purple_conversation_write_message(PURPLE_CONVERSATION(chat), "MXit", _("You have been kicked from this MultiMX."), PURPLE_MESSAGE_SYSTEM, time(NULL));
+	purple_conversation_write_system_message(PURPLE_CONVERSATION(chat),
+		_("You have been kicked from this MultiMX."), 0);
 	purple_chat_conversation_clear_users(chat);
 	purple_serv_got_chat_left(session->con, multimx->chatid);
 }
@@ -574,7 +575,7 @@
 
 	/* Display system message in chat window */
 	tmp = g_strdup_printf("%s: %s", _("You have invited"), purple_buddy_get_alias(buddy));
-	purple_conversation_write_message(PURPLE_CONVERSATION(chat), "MXit", tmp, PURPLE_MESSAGE_SYSTEM, time(NULL));
+	purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), tmp, 0);
 	g_free(tmp);
 }
 
@@ -612,18 +613,15 @@
  *
  *  @param gc			The connection object
  *  @param id			The chat room ID
- *  @param message		The sent message data
- *  @param flags		The message flags
+ *  @param msg			The sent message data
  *  @return				Indicates success / failure
  */
-int mxit_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags)
+int mxit_chat_send(PurpleConnection *gc, int id, PurpleMessage *msg)
 {
 	struct MXitSession* session = purple_connection_get_protocol_data(gc);
 	struct multimx* multimx = NULL;
 	const char* nickname;
 
-	purple_debug_info(MXIT_PLUGIN_ID, "Groupchat %i message send: '%s'\n", id, message);
-
 	/* Find matching MultiMX group */
 	multimx = find_room_by_id(session, id);
 	if (multimx == NULL) {
@@ -632,7 +630,8 @@
 	}
 
 	/* Send packet to MXit */
-	mxit_send_message(session, multimx->roomid, message, TRUE, FALSE);
+	mxit_send_message(session, multimx->roomid,
+		purple_message_get_contents(msg), TRUE, FALSE);
 
 	/* Determine our nickname to display */
 	if (multimx->nickname)
@@ -641,7 +640,8 @@
 		nickname = purple_account_get_private_alias(purple_connection_get_account(gc));		/* local alias */
 
 	/* Display message in chat window */
-	purple_serv_got_chat_in(gc, id, nickname, flags, message, time(NULL));
+	purple_serv_got_chat_in(gc, id, nickname, purple_message_get_flags(msg),
+		purple_message_get_contents(msg), time(NULL));
 
 	return 0;
 }

mercurial