From 5a0f94d26e4567ab57c2ee32376a375ab83c3498 Mon Sep 17 00:00:00 2001 From: Darchigh Date: Tue, 22 Jan 2013 09:49:18 +0100 Subject: [PATCH] Check if just being registered or normal login before doing remoteRosterPush --- src/rostermanager.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/rostermanager.cpp b/src/rostermanager.cpp index 449cd744..daabf440 100644 --- a/src/rostermanager.cpp +++ b/src/rostermanager.cpp @@ -281,12 +281,14 @@ void RosterManager::handleRemoteRosterResponse(boost::shared_ptrgetJID().toString() << ": This server supports remote roster protoXEP"); m_supportRemoteRoster = true; - //If we receive empty RosterPayload initiate full RosterPush - if(payload->getItems().empty()){ - LOG4CXX_INFO(logger, "Received empty Roster. Pushing full Roster."); - for(std::map, boost::pool_allocator< std::pair > >::const_iterator c_it = m_buddies.begin(); - c_it != m_buddies.end(); c_it++) { - sendBuddyRosterPush(c_it->second); + //If we receive empty RosterPayload on login (not register) initiate full RosterPush + if(!m_buddies.empty()){ + if(payload->getItems().empty()){ + LOG4CXX_INFO(logger, "Received empty Roster upon login. Pushing full Roster."); + for(std::map, boost::pool_allocator< std::pair > >::const_iterator c_it = m_buddies.begin(); + c_it != m_buddies.end(); c_it++) { + sendBuddyRosterPush(c_it->second); + } } } return;