15 #include "rosteritem.h"
16 #include "rosteritemdata.h"
47 return m_data->
name();
104 if( m_resources.find( resource ) == m_resources.end() )
107 m_resources[
resource]->setStatus( presence );
112 if( m_resources.find( resource ) == m_resources.end() )
115 m_resources[
resource]->setMessage( msg );
120 if( m_resources.find( resource ) == m_resources.end() )
123 m_resources[
resource]->setPriority( priority );
128 int highestPriority = -255;
130 ResourceMap::const_iterator it = m_resources.begin();
131 for( ; it != m_resources.end() ; ++it )
133 if( (*it).second->priority() > highestPriority )
135 highestPriority = (*it).second->priority();
136 highestResource = (*it).second;
144 if( m_resources.find( resource ) == m_resources.end() )
147 m_resources[
resource]->setExtensions( exts );
152 ResourceMap::iterator it = m_resources.find( resource );
153 if( it != m_resources.end() )
156 m_resources.erase( it );
162 return !m_resources.empty();
167 ResourceMap::const_iterator it = m_resources.find( res );
168 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
void setName(const std::string &name)
void setData(const RosterItemData &rid)
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)
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 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)
const std::string & jid() const
void removeResource(const std::string &resource)
const std::string & jid() const
const StringList & groups() const
const std::string EmptyString
void setName(const std::string &name)
SubscriptionType subscription() const