# class MucRoom | An account's MUC room contact. More...
Full name | `TelEngine::MucRoom`
Definition | `#include <yatecbase.h>`
Inherits | TelEngine::ClientContact [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- explicit MucRoom (ClientAccount* owner, const char* id, const char* name, const char* uri, const char* nick = 0)
- inline MucRoomMember& resource ()
- inline bool ownMember (MucRoomMember* item) const
- inline bool ownMember (const String& item) const
- inline bool available () const
- inline bool canChat () const
- inline bool canChatPrivate () const
- inline bool canChangeSubject () const
- inline bool canInvite () const
- bool canKick (MucRoomMember* member) const
- bool canBan (MucRoomMember* member) const
- inline Message* buildMucRoom (const char* oper)
- Message* buildJoin (bool join, bool history = true, unsigned int sNewer = 0)
- virtual MucRoom* mucRoom ()
- virtual ClientResource* status (bool ref = false)
- MucRoomMember* findMember (const String& nick)
- MucRoomMember* findMember (const String& contact, const String& instance)
- MucRoomMember* findMemberById (const String& id)
- bool hasChat (const String& id)
- virtual void flashChat (const String& id, bool on = true)
- virtual void getChatInput (const String& id, String& text, const String& name = "message")
- virtual void setChatInput (const String& id, const String& text = String::empty(), const String& name = "message")
- virtual void getChatHistory (const String& id, String& text, bool richText = false, const String& name = "history")
- virtual void setChatHistory (const String& id, const String& text, bool richText = false, const String& name = "history")
- virtual void addChatHistory (const String& id, const String& what, NamedList*& params, const String& name = "history")
- virtual void setChatProperty (const String& id, const String& name, const String& prop, const String& value)
- virtual bool showChat (const String& id, bool visible, bool active = false)
- virtual void createChatWindow (const String& id, bool force = false, const char* name = 0)
- virtual void updateChatWindow (const String& id, const NamedList& params)
- virtual bool isChatActive (const String& id)
- void destroyChatWindow (const String& id = String::empty())
- virtual ClientResource* findResource (const String& id, bool ref = false)
- virtual ClientResource* appendResource (const String& nick)
- virtual bool insertResource (ClientResource* res)
- virtual bool removeResource (const String& nick, bool delChat = false)

#### Public Members

- String m_password

#### Protected Methods

- virtual void destroyed ()

## Detailed Description

This class holds a client account's MUC room contact. The list of resources contains MucRoomMember items. Contact nick is held by own MucRoomMember name The contact uri is the room uri The contact name is the room name The contact resource member uri is the account's uri

explicit MucRoom (ClientAccount* owner, const char* id, const char* name, const char* uri, const char* nick = 0) | ### MucRoom

Constructor. Append itself to the owner's list

Parameters:

owner | The contact's owner
id | The contact's id
name | Room name
uri | Room uri
nick | Optional room nick

inline MucRoomMember& resource () | ### resource

Retrieve room resource

Returns: Room resource

inline bool ownMember (MucRoomMember* item) | ### ownMember

[const]

Check if a given resource is the contact's member

Parameters:

item | Member pointer to check

Returns: True if the given resource member is the contact itself

inline bool ownMember (const String& item) | ### ownMember

[const]

Check if a given resource is the contact's member

Parameters:

item | Member id to check

Returns: True if the given resource member is the contact itself

inline bool available () | ### available

[const]

Check if the user has joined the room

Returns: True if the user is in the room

inline bool canChat () | ### canChat

[const]

Check if room chat can be sent

Returns: True if the user is allowed to send chat to room

inline bool canChatPrivate () | ### canChatPrivate

[const]

Check if private chat can be sent

Returns: True if the user is allowed to send private chat

inline bool canChangeSubject () | ### canChangeSubject

[const]

Check if the user can change room subject

Returns: True if the user can change room subject

inline bool canInvite () | ### canInvite

[const]

Check if join invitations can be sent

Returns: True if the user is allowed to invite contacts

bool canKick (MucRoomMember* member) | ### canKick

[const]

Check if the user can kick a given room member

Parameters:

member | Room member

Returns: True if the user can kick the member

bool canBan (MucRoomMember* member) | ### canBan

[const]

Check if the user can ban a given room member

Parameters:

member | Room member

Returns: True if the user can ban the member

inline Message* buildMucRoom (const char* oper) | ### buildMucRoom

Build a muc.room message. Add the room parameter

Parameters:

oper | Operation parameter

Returns: Message pointer

Message* buildJoin (bool join, bool history = true, unsigned int sNewer = 0) | ### buildJoin

Build a muc.room message used to login/logoff

Parameters:

join | True to login, false to logoff
history | True to request room history. Ignored if join is false
sNewer | Request history newer then given seconds. Ignored if 0 or history is false

Returns: Message pointer

MucRoom* mucRoom () | ### mucRoom

[virtual]

Return a MucRoom contact from this one

Returns: MucRoom pointer or 0

Reimplemented from ClientContact.

ClientResource* status (bool ref = false) | ### status

[virtual]

Find the resource with the lowest status (room resource)

Parameters:

ref | True to obtain a referenced pointer

Returns: ClientResource pointer or 0 if not found

Reimplemented from ClientContact.

MucRoomMember* findMember (const String& nick) | ### findMember

Retrieve a room member (or own member) by its nick

Parameters:

nick | Nick to find

Returns: MucRoomMember pointer or 0 if not found

MucRoomMember* findMember (const String& contact, const String& instance) | ### findMember

Retrieve a room member (or own member) by its contact and instance

Parameters:

contact | Member's contact
instance | Member's instance

Returns: MucRoomMember pointer or 0 if not found

MucRoomMember* findMemberById (const String& id) | ### findMemberById

Retrieve a room member (or own member) by its id

Parameters:

id | Member id to find

Returns: MucRoomMember pointer or 0 if not found

bool hasChat (const String& id) | ### hasChat

Check if a given member has chat displayed

Parameters:

id | Member id

Returns: True if the member has chat displayed

Reimplemented from ClientContact.

void flashChat (const String& id, bool on = true) | ### flashChat

[virtual]

Flash chat window/item to notify the user

Parameters:

id | Member id
on | True to start, false to stop flashing

Reimplemented from ClientContact.

void getChatInput (const String& id, String& text, const String& name = "message") | ### getChatInput

[virtual]

Retrieve the contents of the chat input widget

Parameters:

id | Member id
text | Chat input text
name | Chat input widget name

Reimplemented from ClientContact.

void setChatInput (const String& id, const String& text = String::empty(), const String& name = "message") | ### setChatInput

[virtual]

Set the chat input widget text

Parameters:

id | Member id
text | Chat input text
name | Chat input widget name

Reimplemented from ClientContact.

void getChatHistory (const String& id, String& text, bool richText = false, const String& name = "history") | ### getChatHistory

[virtual]

Retrieve the contents of the chat history widget

Parameters:

id | Member id
text | Chat history text
richText | Retrieve rich/plain text flag
name | Chat history widget name

Reimplemented from ClientContact.

void setChatHistory (const String& id, const String& text, bool richText = false, const String& name = "history") | ### setChatHistory

[virtual]

Set the contents of the chat history widget

Parameters:

id | Member id
text | Chat history text
richText | Set rich/plain text flag
name | Chat history widget name

Reimplemented from ClientContact.

void addChatHistory (const String& id, const String& what, NamedList*& params, const String& name = "history") | ### addChatHistory

[virtual]

Add an entry to chat history

Parameters:

id | Member id
what | Item to add (chat_in, chat_out, ...)
params | Chat history item parameters (it will be consumed and zeroed)
name | Chat history widget name

Reimplemented from ClientContact.

void setChatProperty (const String& id, const String& name, const String& prop, const String& value) | ### setChatProperty

[virtual]

Set a chat widget' property

Parameters:

id | Member id
name | Widget name
prop | Property name
value | Property value

Reimplemented from ClientContact.

bool showChat (const String& id, bool visible, bool active = false) | ### showChat

[virtual]

Show or hide a member's chat

Parameters:

id | Member id
visible | True to show, false to hide
active | True to activate the chat

Returns: True on success

Reimplemented from ClientContact.

void createChatWindow (const String& id, bool force = false, const char* name = 0) | ### createChatWindow

[virtual]

Create a member's chat

Parameters:

id | Member id
force | True to destroy the current one if any
name | The window's name. Defaults to global name if empty

Reimplemented from ClientContact.

void updateChatWindow (const String& id, const NamedList& params) | ### updateChatWindow

[virtual]

Update member parameters in chat window

Parameters:

id | Member id
params | Parameters to set

Reimplemented from ClientContact.

bool isChatActive (const String& id) | ### isChatActive

[virtual]

Check if a member's chat is active

Returns: True if the members's chat page is active

Reimplemented from ClientContact.

void destroyChatWindow (const String& id = String::empty()) | ### destroyChatWindow

Close a member's chat or all chats

Parameters:

id | Member id. Let it empty to clear all chats

Reimplemented from ClientContact.

ClientResource* findResource (const String& id, bool ref = false) | ### findResource

[virtual]

Retrieve a room member (or own member) by its id

Parameters:

id | The id of the desired member
ref | True to obtain a referenced pointer

Returns: ClientResource pointer or 0 if not found

Reimplemented from ClientContact.

ClientResource* appendResource (const String& nick) | ### appendResource

[virtual]

Append a member having a given nick

Parameters:

nick | Member nick

Returns: ClientResource pointer or 0 if a resource with the given name already exists

Reimplemented from ClientContact.

bool insertResource (ClientResource* res) | ### insertResource

[virtual]

Insert a resource in the list by its priority. If the resource is already there it will be extracted and re-inserted

Parameters:

res | The resource to insert

Returns: True on success, false a resource with the same name already exists

Reimplemented from ClientContact.

bool removeResource (const String& nick, bool delChat = false) | ### removeResource

[virtual]

Remove a contact having a given nick

Parameters:

nick | The contact nick
delChat | True to delete the chat

Returns: True if the contact was removed

Reimplemented from ClientContact.

String m_password | ### m_password

void destroyed () | ### destroyed

[protected virtual]

Room password

Reimplemented from ClientContact.

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.