Changeset - e14d3c30e92e
[Not reviewed]
0 1 0
Jan Kaluza - 13 years ago 2012-07-30 13:52:29
hanzz.k@gmail.com
Handle situation where nickname is emtpy in groupchat
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/conversation.cpp
Show inline comments
 
@@ -84,8 +84,13 @@ void Conversation::handleMessage(boost::shared_ptr<Swift::Message> &message, con
 
		if (legacyName.find_last_of("@") != std::string::npos) {
 
			legacyName.replace(legacyName.find_last_of("@"), 1, "%"); // OK
 
		}
 

	
 
		std::string n = nickname;
 
		if (n.empty()) {
 
			n = " ";
 
		}
 
		message->setTo(m_jid);
 
		message->setFrom(Swift::JID(legacyName, m_conversationManager->getComponent()->getJID().toBare(), nickname));
 
		message->setFrom(Swift::JID(legacyName, m_conversationManager->getComponent()->getJID().toBare(), n));
 
		m_conversationManager->getComponent()->getStanzaChannel()->sendMessage(message);
 
	}
 
}
0 comments (0 inline, 0 general)