|
Yate
|
An account's MUC room contact. More...
#include <yatecbase.h>
Public Member Functions | |
| MucRoom (ClientAccount *owner, const char *id, const char *name, const char *uri, const char *nick=0) | |
| MucRoomMember & | resource () |
| bool | ownMember (MucRoomMember *item) const |
| bool | ownMember (const String &item) const |
| bool | available () const |
| bool | canChat () const |
| bool | canChatPrivate () const |
| bool | canChangeSubject () const |
| bool | canInvite () const |
| bool | canKick (MucRoomMember *member) const |
| bool | canBan (MucRoomMember *member) const |
| 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 *¶ms, 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 ¶ms) |
| 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 Member Functions inherited from ClientContact | |
| ClientContact (ClientAccount *owner, const char *id, const char *name=0, const char *uri=0) | |
| ClientContact (ClientAccount *owner, const NamedList ¶ms, const char *id=0, const char *uri=0) | |
| ClientAccount * | account () |
| const String & | accountName () const |
| const URI & | uri () const |
| void | setUri (const char *u) |
| const String & | subscriptionStr () const |
| bool | subscriptionFrom () const |
| bool | subscriptionTo () const |
| bool | setSubscription (const String &value) |
| ObjList & | resources () |
| bool | online () const |
| void | setOnline (bool on) |
| ObjList & | groups () |
| bool | local (bool defVal=false) const |
| void | setLocal (bool on) |
| bool | remote (bool defVal=false) const |
| void | setRemote (bool on) |
| void | setDockedChat (bool on) |
| void | getContactSection (String &buf) |
| virtual const String & | toString () const |
| String & | buildInstanceId (String &dest, const String &inst=String::empty()) |
| void | buildIdHash (String &buf, const String &prefix=String::empty()) |
| bool | isChatWnd (Window *wnd) |
| bool | hasChat () |
| virtual void | flashChat (bool on=true) |
| virtual bool | sendChat (const char *body, const String &res=String::empty(), const String &type=String::empty(), const char *state="active") |
| virtual void | getChatInput (String &text, const String &name="message") |
| virtual void | setChatInput (const String &text=String::empty(), const String &name="message") |
| virtual void | getChatHistory (String &text, bool richText=false, const String &name="history") |
| virtual void | setChatHistory (const String &text, bool richText=false, const String &name="history") |
| virtual void | addChatHistory (const String &what, NamedList *¶ms, const String &name="history") |
| virtual void | getChatProperty (const String &name, const String &prop, String &value) |
| virtual void | setChatProperty (const String &name, const String &prop, const String &value) |
| bool | isChatVisible () |
| virtual bool | showChat (bool visible, bool active=false) |
| Window * | getChatWnd () |
| virtual void | createChatWindow (bool force=false, const char *name=0) |
| virtual void | updateChatWindow (const NamedList ¶ms, const char *title=0, const char *icon=0) |
| virtual bool | isChatActive () |
| void | destroyChatWindow () |
| virtual String * | findGroup (const String &group) |
| virtual bool | appendGroup (const String &group) |
| virtual bool | removeGroup (const String &group) |
| virtual bool | setGroups (const NamedList &list, const String ¶m) |
| virtual ClientResource * | findAudioResource (bool ref=false) |
| virtual ClientResource * | findFileTransferResource (bool ref=false) |
| virtual bool | removeResource (const String &id) |
| NamedList & | share () |
| bool | haveShare () const |
| virtual void | updateShare () |
| virtual void | saveShare () |
| virtual void | clearShare () |
| virtual bool | setShareDir (const String &name, const String &path, bool save=true) |
| virtual bool | removeShare (const String &name, bool save=true) |
| ObjList & | shared () |
| bool | haveShared () const |
| virtual ClientDir * | getShared (const String &name, bool create=false) |
| virtual bool | removeShared (const String &name=String::empty(), ClientDir **removed=0) |
Public Member Functions inherited from RefObject | |
| RefObject () | |
| virtual | ~RefObject () |
| virtual void * | getObject (const String &name) const |
| virtual bool | alive () const |
| bool | ref () |
| bool | deref () |
| int | refcount () const |
| virtual void | destruct () |
Public Member Functions inherited from GenObject | |
| GenObject () | |
| virtual | ~GenObject () |
| virtual const String & | traceId () const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Public Attributes | |
| String | m_password |
Public Attributes inherited from ClientContact | |
| String | m_name |
| NamedList | m_params |
Protected Member Functions | |
| virtual void | destroyed () |
Protected Member Functions inherited from ClientContact | |
| ClientContact (ClientAccount *owner, const char *id, bool mucRoom) | |
| void | removeFromOwner () |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
Additional Inherited Members | |
Public Types inherited from ClientContact | |
| enum | Subscription { SubFrom = 0x01, SubTo = 0x02 } |
Static Public Member Functions inherited from ClientContact | |
| static String & | buildContactId (String &dest, const String &account, const String &contact) |
| static void | splitContactId (const String &src, String &account) |
| static void | splitContactInstanceId (const String &src, String &account, String &contact, String *instance=0) |
| static String & | buildContactInstanceId (String &dest, const String &cId, const String &inst=String::empty()) |
Static Public Member Functions inherited from RefObject | |
| static bool | alive (const RefObject *obj) |
| static bool | efficientIncDec () |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Static Public Attributes inherited from ClientContact | |
| static String | s_chatPrefix |
| static String | s_dockedChatWnd |
| static String | s_dockedChatWidget |
| static String | s_mucsWnd |
| static String | s_chatInput |
Protected Attributes inherited from ClientContact | |
| ClientAccount * | m_owner |
| bool | m_online |
| String | m_id |
| String | m_subscription |
| Flags32 | m_sub |
| URI | m_uri |
| ObjList | m_resources |
| ObjList | m_groups |
| bool | m_dockedChat |
| String | m_chatWndName |
| NamedList | m_share |
| ObjList | m_shared |
An account's MUC room contact.
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 |
Constructor. Append itself to the owner's list
| owner | The contact's owner |
| id | The contact's id |
| name | Room name |
| uri | Room uri |
| nick | Optional room nick |
|
virtual |
Add an entry to chat history
| 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 |
|
virtual |
Append a member having a given nick
| nick | Member nick |
Reimplemented from ClientContact.
|
inline |
Check if the user has joined the room
References ClientResource::online().
Referenced by MucRoom::canChangeSubject(), MucRoom::canChat(), MucRoom::canChatPrivate(), and MucRoom::canInvite().
| Message* buildJoin | ( | bool | join, |
| bool | history = true, |
||
| unsigned int | sNewer = 0 |
||
| ) |
Build a muc.room message used to login/logoff
| 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 |
|
inline |
Build a muc.room message. Add the room parameter
| oper | Operation parameter |
References ClientContact::accountName(), NamedList::addParam(), Client::buildMessage(), and ClientContact::uri().
| bool canBan | ( | MucRoomMember * | member | ) | const |
Check if the user can ban a given room member
| member | Room member |
|
inline |
Check if the user can change room subject
References MucRoom::available().
|
inline |
Check if room chat can be sent
References MucRoom::available().
|
inline |
Check if private chat can be sent
References MucRoom::available().
|
inline |
Check if join invitations can be sent
References MucRoom::available().
| bool canKick | ( | MucRoomMember * | member | ) | const |
Check if the user can kick a given room member
| member | Room member |
|
virtual |
Create a member's chat
| id | Member id |
| force | True to destroy the current one if any |
| name | The window's name. Defaults to global name if empty |
| void destroyChatWindow | ( | const String & | id = String::empty() | ) |
Close a member's chat or all chats
| id | Member id. Let it empty to clear all chats |
|
protectedvirtual |
Remove from owner. Destroy the chat window. Release data
Reimplemented from ClientContact.
| MucRoomMember* findMember | ( | const String & | nick | ) |
Retrieve a room member (or own member) by its nick
| nick | Nick to find |
| MucRoomMember* findMember | ( | const String & | contact, |
| const String & | instance | ||
| ) |
Retrieve a room member (or own member) by its contact and instance
| contact | Member's contact |
| instance | Member's instance |
| MucRoomMember* findMemberById | ( | const String & | id | ) |
Retrieve a room member (or own member) by its id
| id | Member id to find |
|
virtual |
Retrieve a room member (or own member) by its id
| id | The id of the desired member |
| ref | True to obtain a referenced pointer |
Reimplemented from ClientContact.
|
virtual |
Flash chat window/item to notify the user
| id | Member id |
| on | True to start, false to stop flashing |
|
virtual |
Retrieve the contents of the chat history widget
| id | Member id |
| text | Chat history text |
| richText | Retrieve rich/plain text flag |
| name | Chat history widget name |
|
virtual |
Retrieve the contents of the chat input widget
| id | Member id |
| text | Chat input text |
| name | Chat input widget name |
| bool hasChat | ( | const String & | id | ) |
Check if a given member has chat displayed
| id | Member id |
|
inlinevirtual |
Insert a resource in the list by its priority. If the resource is already there it will be extracted and re-inserted
| res | The resource to insert |
Reimplemented from ClientContact.
|
virtual |
Check if a member's chat is active
|
inlinevirtual |
Return a MucRoom contact from this one
Reimplemented from ClientContact.
|
inline |
Check if a given resource is the contact's member
| item | Member pointer to check |
|
inline |
Check if a given resource is the contact's member
| item | Member id to check |
References ClientResource::toString().
|
virtual |
Remove a contact having a given nick
| nick | The contact nick |
| delChat | True to delete the chat |
|
inline |
Retrieve room resource
|
virtual |
Set the contents of the chat history widget
| id | Member id |
| text | Chat history text |
| richText | Set rich/plain text flag |
| name | Chat history widget name |
|
virtual |
Set the chat input widget text
| id | Member id |
| text | Chat input text |
| name | Chat input widget name |
|
virtual |
Set a chat widget' property
| id | Member id |
| name | Widget name |
| prop | Property name |
| value | Property value |
|
virtual |
Show or hide a member's chat
| id | Member id |
| visible | True to show, false to hide |
| active | True to activate the chat |
|
inlinevirtual |
Find the resource with the lowest status (room resource)
| ref | True to obtain a referenced pointer |
Reimplemented from ClientContact.
References RefObject::ref().
Update member parameters in chat window
| id | Member id |
| params | Parameters to set |
| String m_password |
Room password
1.8.8