Yate
Public Member Functions | Protected Member Functions | Friends

XMPPUserRoster Class Reference

The roster of a local user. More...

#include <yatejabber.h>

Inheritance diagram for XMPPUserRoster:
RefObject Mutex GenObject Lockable

List of all members.

Public Member Functions

virtual ~XMPPUserRoster ()
const JabberIDjid () const
JBPresenceengine ()
JIDResourceListresources ()
ObjListusers ()
XMPPUsergetUser (const JabberID &jid, bool add=false, bool *added=0)
bool removeUser (const JabberID &remote)
void cleanup ()
bool timeout (u_int64_t time)
XMLElementcreateDiscoInfoResult (const char *from, const char *to, const char *id)

Protected Member Functions

 XMPPUserRoster (JBPresence *engine, const char *node, const char *domain, JBEngine::Protocol proto=JBEngine::Component)

Friends

class JBPresence
class JBClientStream
class XMPPUser

Detailed Description

The roster of a local user.

This class holds the roster for a local user.


Constructor & Destructor Documentation

virtual ~XMPPUserRoster ( ) [virtual]

Destructor. Remove this roster from engine's queue.

XMPPUserRoster ( JBPresence engine,
const char *  node,
const char *  domain,
JBEngine::Protocol  proto = JBEngine::Component 
) [protected]

Constructor.

Parameters:
enginePointer to the presence engine this user belongs to
nodeUser's name
domainUser's domain
protoProtocol. Used to create identity

Member Function Documentation

void cleanup ( ) [inline]

() Clear remote user list.

XMLElement* createDiscoInfoResult ( const char *  from,
const char *  to,
const char *  id 
) [inline]

Create an iq result to respond to disco info. Add user's features and identity

Parameters:
fromThe from attribute
toThe to attribute
idThe id attribute
Returns:
XMLElement pointer

References XMPPUtils::createDiscoInfoRes().

JBPresence* engine ( ) [inline]

Get the presence engine this user belongs to.

Returns:
Pointer to the presence engine this user belongs to.
XMPPUser* getUser ( const JabberID jid,
bool  add = false,
bool *  added = 0 
)

Get a remote user. This method is thread safe.

Parameters:
jidUser's jid.
addTrue to add if not found.
addedOptional flag to set if added a new user.
Returns:
Referenced pointer to the user or 0.
const JabberID& jid ( ) const [inline]

Get the local user's jid.

Returns:
The local user's jid.
bool removeUser ( const JabberID remote)

Remove a remote user. This method is thread safe.

Parameters:
remoteThe user to remove.
Returns:
False if no more users.
JIDResourceList& resources ( ) [inline]

Get the list of available resources belonging to the same user

Returns:
The list of available resources
bool timeout ( u_int64_t  time)

Check timeout. This method is thread safe.

Parameters:
timeCurrent time.
Returns:
True to remove the roster.
ObjList& users ( ) [inline]

Get the list of remote users

Returns:
The list of remote users

The documentation for this class was generated from the following file: