libpurple/protocols/mxit/protocol.c

changeset 33710
0d7ead568881
parent 33661
2ebcb105e606
parent 33706
d6b2b231d0cf
child 33811
5ab172aeeff2
--- a/libpurple/protocols/mxit/protocol.c	Sun Jan 27 05:57:39 2013 -0500
+++ b/libpurple/protocols/mxit/protocol.c	Tue Jan 29 15:38:45 2013 +0100
@@ -1065,8 +1065,9 @@
  *
  *  @param session		The MXit session object
  *  @param username		The username of the contact being denied
+ *  @param reason		The message describing the reason for the rejection (can be NULL).
  */
-void mxit_send_deny_sub( struct MXitSession* session, const char* username )
+void mxit_send_deny_sub( struct MXitSession* session, const char* username, const char* reason )
 {
 	char		data[CP_MAX_PACKET];
 	int			datalen;
@@ -1077,6 +1078,10 @@
 								username
 	);
 
+	/* append reason (if one is set) */
+	if ( reason )
+		datalen += sprintf( data + datalen, "%c%s", CP_FLD_TERM, reason );
+
 	/* queue packet for transmission */
 	mxit_queue_packet( session, data, datalen, CP_CMD_DENY );
 }

mercurial