Handle situation where nickname is emtpy in groupchat
This commit is contained in:
parent
b26808c36e
commit
e14d3c30e9
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue