15 #include "rosteritem.h"
16 #include "rosteritemdata.h"
49 return m_data->
name();
114 if( m_resources.find( resource ) == m_resources.end() )
117 m_resources[
resource]->setStatus( presence );
122 if( m_resources.find( resource ) == m_resources.end() )
125 m_resources[
resource]->setMessage( msg );
130 if( m_resources.find( resource ) == m_resources.end() )
133 m_resources[
resource]->setPriority( priority );
138 int highestPriority = -255;
140 ResourceMap::const_iterator it = m_resources.begin();
141 for( ; it != m_resources.end() ; ++it )
143 if( (*it).second->priority() > highestPriority )
145 highestPriority = (*it).second->priority();
146 highestResource = (*it).second;
154 if( m_resources.find( resource ) == m_resources.end() )
157 m_resources[
resource]->setExtensions( exts );
162 ResourceMap::iterator it = m_resources.find( resource );
163 if( it != m_resources.end() )
166 m_resources.erase( it );
172 return !m_resources.empty();
177 ResourceMap::const_iterator it = m_resources.find( res );
178 return it != m_resources.end() ? (*it).second : 0;
void setSubscription(const std::string &subscription, const std::string &ask)
void setPresence(const std::string &resource, Presence::PresenceType presence)
std::list< const StanzaExtension * > StanzaExtensionList
void setGroups(const StringList &groups)
const Resource * resource(const std::string &res) const
std::list< std::string > StringList
const JID & jidJID() const
void setName(const std::string &name)
void setData(const RosterItemData &rid)
GLOOX_DEPRECATED const std::string & jid() const
void setPriority(const std::string &resource, int priority)
void clearMap(std::map< Key, T * > &M)
Holds resource attributes.
void setStatus(const std::string &resource, const std::string &msg)
void setGroups(const StringList &groups)
The namespace for the gloox library.
A class holding roster item data.
void setSubscription(const std::string &subscription, const std::string &ask)
RosterItem(const std::string &jid, const std::string &name=EmptyString)
SubscriptionType subscription() const
const JID & jidJID() const
const StringList groups() const
const Resource * highestResource() const
const std::string & name() const
const std::string & name() const
void setExtensions(const std::string &resource, const StanzaExtensionList &exts)
void removeResource(const std::string &resource)
GLOOX_DEPRECATED const std::string & jid() const
const StringList & groups() const
const std::string EmptyString
void setName(const std::string &name)
SubscriptionType subscription() const