Do not create conversation when the message contain nickname, because that means the conversation should be MUC, but user didn't connect to that room yet
This commit is contained in:
parent
38f907aa6e
commit
5812171372
1 changed files with 9 additions and 1 deletions
|
@ -633,8 +633,16 @@ void NetworkPluginServer::handleConvMessagePayload(const std::string &data, bool
|
|||
msg->addPayload(boost::make_shared<Swift::Delay>(timestamp));
|
||||
}
|
||||
|
||||
// Create new Conversation if it does not exist
|
||||
|
||||
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
|
||||
if (!conv) {
|
||||
conv = new NetworkConversation(user->getConversationManager(), payload.buddyname());
|
||||
user->getConversationManager()->addConversation(conv);
|
||||
|
|
Loading…
Add table
Reference in a new issue