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();
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;
Holds resource attributes.
A class holding roster item data.
void setGroups(const StringList &groups)
SubscriptionType subscription() const
void setSubscription(const std::string &subscription, const std::string &ask)
void setName(const std::string &name)
GLOOX_DEPRECATED const std::string & jid() const
const std::string & name() const
const StringList & groups() const
const JID & jidJID() const
RosterItem(const std::string &jid, const std::string &name=EmptyString)
void setGroups(const StringList &groups)
const std::string & name() const
SubscriptionType subscription() const
const Resource * highestResource() const
void setPriority(const std::string &resource, int priority)
void setData(const RosterItemData &rid)
void setSubscription(const std::string &subscription, const std::string &ask)
const JID & jidJID() const
void setName(const std::string &name)
const Resource * resource(const std::string &res) const
const StringList groups() const
void removeResource(const std::string &resource)
void setStatus(const std::string &resource, const std::string &msg)
GLOOX_DEPRECATED const std::string & jid() const
void setExtensions(const std::string &resource, const StanzaExtensionList &exts)
void setPresence(const std::string &resource, Presence::PresenceType presence)
void clearMap(std::map< Key, T * > &M)
The namespace for the gloox library.
std::list< const StanzaExtension * > StanzaExtensionList
std::list< std::string > StringList
const std::string EmptyString