Changeset - cf53da03dcda
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-04-03 00:05:41
hanzz.k@gmail.com
Strip messages from libpurple before passing them to libtransport
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
spectrum/src/main.cpp
Show inline comments
 
@@ -164,25 +164,28 @@ static void conv_destroy(PurpleConversation *conv) {
 
	}
 
}
 

	
 
static void conv_write_im(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime) {
 
	// Don't forwards our own messages.
 
	if (flags & PURPLE_MESSAGE_SEND || flags & PURPLE_MESSAGE_SYSTEM)
 
		return;
 
	SpectrumConversation *s_conv = (SpectrumConversation *) conv->ui_data;
 
	if (!s_conv)
 
		return;
 

	
 
	boost::shared_ptr<Swift::Message> msg(new Swift::Message());
 

	
 
	char *striped = purple_markup_strip_html(message);
 
	msg->setBody(message);
 
	g_free(striped);
 

	
 
	s_conv->handleMessage(msg);
 
}
 

	
 
static PurpleConversationUiOps conversation_ui_ops =
 
{
 
	conv_new,
 
	conv_destroy,
 
	NULL,//conv_write_chat,                              /* write_chat           */
 
	conv_write_im,             /* write_im             */
 
	NULL,//conv_write_conv,           /* write_conv           */
 
	NULL,//conv_chat_add_users,       /* chat_add_users       */
0 comments (0 inline, 0 general)