diff --git a/src/rostermanager.cpp b/src/rostermanager.cpp index 377ddffd..db888909 100644 --- a/src/rostermanager.cpp +++ b/src/rostermanager.cpp @@ -141,8 +141,6 @@ void RosterManager::handleBuddyChanged(Buddy *buddy) { } void RosterManager::setBuddyCallback(Buddy *buddy) { - m_setBuddyTimer->onTick.disconnect(boost::bind(&RosterManager::setBuddyCallback, this, buddy)); - LOG4CXX_INFO(logger, "Associating buddy " << buddy->getName() << " with " << m_user->getJID().toString()); m_buddies[buddy->getName()] = buddy; onBuddySet(buddy); @@ -153,21 +151,17 @@ void RosterManager::setBuddyCallback(Buddy *buddy) { sendBuddyRosterPush(buddy); } else { - if (m_setBuddyTimer->onTick.empty()) { - m_setBuddyTimer->stop(); - - if (m_supportRemoteRoster) { - sendBuddyRosterPush(buddy); + if (m_supportRemoteRoster) { + sendBuddyRosterPush(buddy); + } + else { + // Send RIE only if there's resource which supports it. + Swift::JID jidWithRIE = m_user->getJIDWithFeature("http://jabber.org/protocol/rosterx"); + if (jidWithRIE.isValid()) { + m_RIETimer->start(); } else { - // Send RIE only if there's resource which supports it. - Swift::JID jidWithRIE = m_user->getJIDWithFeature("http://jabber.org/protocol/rosterx"); - if (jidWithRIE.isValid()) { - m_RIETimer->start(); - } - else { - sendBuddySubscribePresence(buddy); - } + sendBuddySubscribePresence(buddy); } } } diff --git a/src/user.cpp b/src/user.cpp index 7049dc33..47d63065 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -97,6 +97,10 @@ Swift::JID User::getJIDWithFeature(const std::string &feature) { else { continue; } + + if (!discoInfo) { + continue; + } #else continue; #endif