libpurple/conversation.c

changeset 36076
a0e5b68ff4ef
parent 35916
96593c46d85c
child 36077
b7328f4317c7
--- a/libpurple/conversation.c	Thu May 22 14:08:33 2014 +0200
+++ b/libpurple/conversation.c	Thu May 22 15:15:16 2014 +0200
@@ -133,18 +133,24 @@
 	msgflags |= PURPLE_MESSAGE_SEND;
 
 	if (PURPLE_IS_IM_CONVERSATION(conv)) {
+		PurpleMessage *msg;
+
+		msg = purple_message_new(purple_conversation_get_name(conv),
+			sent, msgflags);
+
+		/* TODO: use msg! */
 		purple_signal_emit(purple_conversations_get_handle(), "sending-im-msg",
 						 account,
 						 purple_conversation_get_name(conv), &sent);
 
-		if (sent != NULL && sent[0] != '\0') {
+		if (!purple_message_is_empty(msg)) {
 
-			err = purple_serv_send_im(gc, purple_conversation_get_name(conv),
-			                   sent, msgflags);
+			err = purple_serv_send_im(gc, msg);
 
 			if ((err > 0) && (displayed != NULL))
 				purple_conversation_write_message(conv, NULL, displayed, msgflags, time(NULL));
 
+			/* TODO: use msg! */
 			purple_signal_emit(purple_conversations_get_handle(), "sent-im-msg",
 							 account,
 							 purple_conversation_get_name(conv), sent);

mercurial