Changeset - 441ce14dbf54
[Not reviewed]
0 2 0
Jan Kaluza - 14 years ago 2011-07-12 08:01:50
hanzz.k@gmail.com
fixed xhtmlim
2 files changed with 16 insertions and 1 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -648,6 +648,8 @@ static void conv_write_im(PurpleConversation *conv, const char *who, const char
 
		xhtml_ = "";
 
	}
 

	
 
// 	LOG4CXX_INFO(logger, "Received message body='" << message_ << "' xhtml='" << xhtml_ << "'");
 

	
 
	np->handleMessage(np->m_accounts[account], w, message_, "", xhtml_);
 
}
 

	
src/networkpluginserver.cpp
Show inline comments
 
@@ -35,6 +35,7 @@
 
#include "Swiften/Elements/StreamError.h"
 
#include "Swiften/Network/BoostConnectionServer.h"
 
#include "Swiften/Elements/AttentionPayload.h"
 
#include "Swiften/Elements/XHTMLIMPayload.h"
 
#include "pbnetwork.pb.h"
 
#include "sys/wait.h"
 
#include "sys/signal.h"
 
@@ -391,6 +392,10 @@ void NetworkPluginServer::handleConvMessagePayload(const std::string &data, bool
 
		msg->setBody(payload.message());
 
	}
 

	
 
	if (!payload.xhtml().empty()) {
 
		msg->addPayload(boost::make_shared<Swift::XHTMLIMPayload>(payload.xhtml()));
 
	}
 

	
 
	NetworkConversation *conv = (NetworkConversation *) user->getConversationManager()->getConversation(payload.buddyname());
 
	if (!conv) {
 
		conv = new NetworkConversation(user->getConversationManager(), payload.buddyname());
 
@@ -695,11 +700,19 @@ void NetworkPluginServer::handleMessageReceived(NetworkConversation *conv, boost
 
	}
 
	
 

	
 
	if (!msg->getBody().empty()) {
 
	std::string xhtml;
 
	boost::shared_ptr<Swift::XHTMLIMPayload> xhtmlPayload = msg->getPayload<Swift::XHTMLIMPayload>();
 
	if (xhtmlPayload) {
 
		xhtml = xhtmlPayload->getBody();
 
	}
 

	
 
	// Send normal message
 
	if (!msg->getBody().empty() || !xhtml.empty()) {
 
		pbnetwork::ConversationMessage m;
 
		m.set_username(conv->getConversationManager()->getUser()->getJID().toBare());
 
		m.set_buddyname(conv->getLegacyName());
 
		m.set_message(msg->getBody());
 
		m.set_xhtml(xhtml);
 

	
 
		std::string message;
 
		m.SerializeToString(&message);
0 comments (0 inline, 0 general)