Swiften backend: fix processing IQ from JIDs with empty resources
This commit is contained in:
parent
a641f9cd9a
commit
653d3efc5e
1 changed files with 7 additions and 1 deletions
|
@ -143,7 +143,13 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient {
|
|||
boost::shared_ptr<Swift::IQ> iq = boost::dynamic_pointer_cast<Swift::IQ>(stanza);
|
||||
if (iq) {
|
||||
if (m_handlers[user]->m_id2resource.find(stanza->getID()) != m_handlers[user]->m_id2resource.end()) {
|
||||
iq->setTo(Swift::JID(iq->getTo().getNode(), iq->getTo().getDomain(), m_handlers[user]->m_id2resource[stanza->getID()]));
|
||||
std::string resource = m_handlers[user]->m_id2resource[stanza->getID()];
|
||||
if (resource.empty()) {
|
||||
iq->setTo(Swift::JID(iq->getTo().getNode(), iq->getTo().getDomain()));
|
||||
} else {
|
||||
iq->setTo(Swift::JID(iq->getTo().getNode(), iq->getTo().getDomain(), resource));
|
||||
}
|
||||
|
||||
m_handlers[user]->m_id2resource.erase(stanza->getID());
|
||||
}
|
||||
client->getIQRouter()->sendIQ(iq);
|
||||
|
|
Loading…
Add table
Reference in a new issue