Changeset - 1e8777a54268
[Not reviewed]
0 1 0
Vitaly Takmazov - 13 years ago 2012-12-10 20:05:32
vitalyster@gmail.com
do not serialize empty from attribute in delay
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/networkpluginserver.cpp
Show inline comments
 
@@ -647,25 +647,27 @@ void NetworkPluginServer::handleConvMessagePayload(const std::string &data, bool
 
	}
 
	else {
 
		msg->setBody(payload.message());
 
	}
 

	
 
	// Add xhtml-im payload.
 
	if (CONFIG_BOOL(m_config, "service.enable_xhtml") && !payload.xhtml().empty()) {
 
		msg->addPayload(boost::make_shared<Swift::XHTMLIMPayload>(payload.xhtml()));
 
	}
 

	
 
	if (!payload.timestamp().empty()) {
 
		boost::posix_time::ptime timestamp = boost::posix_time::from_iso_string(payload.timestamp());
 
		msg->addPayload(boost::make_shared<Swift::Delay>(timestamp));
 
		boost::shared_ptr<Swift::Delay> delay(boost::make_shared<Swift::Delay>());
 
		delay->setStamp(timestamp);
 
		msg->addPayload(delay);
 
	}
 

	
 
	
 
	NetworkConversation *conv = (NetworkConversation *) user->getConversationManager()->getConversation(payload.buddyname());
 

	
 
	// We can't create Conversation for payload with nickname, because this means the message is from room,
 
	// but this user is not in any room, so it's OK to just reject this message
 
	if (!conv && !payload.nickname().empty()) {
 
		return;
 
	}
 

	
 
	// Create new Conversation if it does not exist
0 comments (0 inline, 0 general)