Changeset - c0aa6483c6a4
[Not reviewed]
0 2 0
Vitaly Takmazov - 8 years ago 2018-02-01 18:57:16
vitalyster@gmail.com
Remote Roster ProtoXEP -> XEP-0321 or XEP-0356
2 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
include/transport/RosterManager.h
Show inline comments
 
@@ -57,13 +57,13 @@ class RosterManager {
 
		virtual void doAddBuddy(Buddy *buddy) = 0;
 
		virtual void doUpdateBuddy(Buddy *buddy) = 0;
 

	
 
		/// Associates the buddy with this roster,
 
		/// and if the buddy is not already in XMPP user's server-side roster, the proper requests
 
		/// are sent to XMPP user (subscribe presences, Roster Item Exchange stanza or
 
		/// the buddy is added to server-side roster using remote-roster protoXEP).
 
		/// the buddy is added to server-side roster using XEP-0321 or XEP-0356).
 
		/// \param buddy Buddy
 
		void setBuddy(Buddy *buddy);
 

	
 
		/// Deassociates the buddy with this roster.
 
		/// \param buddy Buddy.
 
		void unsetBuddy(Buddy *buddy);
spectrum/src/frontends/xmpp/XMPPRosterManager.cpp
Show inline comments
 
@@ -195,17 +195,17 @@ void XMPPRosterManager::handleBuddyRosterPushResponse(Swift::ErrorPayload::ref e
 
}
 

	
 
void XMPPRosterManager::handleRemoteRosterResponse(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::RosterPayload> payload, Swift::ErrorPayload::ref error) {
 
	m_remoteRosterRequest.reset();
 
	if (error) {
 
		m_supportRemoteRoster = false;
 
		LOG4CXX_INFO(logger, m_user->getJID().toString() << ": This server does not support remote roster protoXEP");
 
		LOG4CXX_INFO(logger, m_user->getJID().toString() << ": This server does not allow us to modify your roster, consider enabling XEP-0321 or XEP-0356 support");
 
		return;
 
	}
 

	
 
	LOG4CXX_INFO(logger, m_user->getJID().toString() << ": This server supports remote roster protoXEP");
 
	LOG4CXX_INFO(logger, m_user->getJID().toString() << ": Roster modification is allowed");
 
	m_supportRemoteRoster = true;
 

	
 
	//If we receive empty RosterPayload on login (not register) initiate full RosterPush
 
	if(!m_buddies.empty() && payload->getItems().empty()){
 
			LOG4CXX_INFO(logger, "Received empty Roster upon login. Pushing full Roster.");
 
			for(std::map<std::string, Buddy *, std::less<std::string>, boost::pool_allocator< std::pair<const std::string, Buddy *> > >::const_iterator c_it = m_buddies.begin();
0 comments (0 inline, 0 general)