QXmpp: QXmppMucRoom Class Reference

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppMucRoom Class Reference

The QXmppMucRoom class represents a multi-user chat room as defined by XEP-0045: Multi-User Chat. More...

`#include <QXmppMucManager.h>`

## Public Types
enum | Action { NoAction = 0 , SubjectAction = 1 , ConfigurationAction = 2 , PermissionsAction = 4 , KickAction = 8 }
| This enum is used to describe chat room actions. More...

## Public Member Functions
Actions | allowedActions () const
| Returns the actions you are allowed to perform on the room.
bool | isJoined () const
| Returns true if you are currently in the room.
QString | jid () const
| Returns the chat room's bare JID.
QString | name () const
QString | nickName () const
| Returns your own nickname.
void | setNickName (const QString &nickName)
Q_INVOKABLE QString | participantFullJid (const QString &jid) const
QXmppPresence | participantPresence (const QString &jid) const
QStringList | participants () const
QString | password () const
| Returns the chat room password.
void | setPassword (const QString &password)
QString | subject () const
| Returns the room's subject.
void | setSubject (const QString &subject)
Q_SIGNAL void | allowedActionsChanged (QXmppMucRoom::Actions actions)
| This signal is emitted when the allowed actions change.
Q_SIGNAL void | configurationReceived (const QXmppDataForm &configuration)
| This signal is emitted when the configuration form for the room is received.
Q_SIGNAL void | error (const QXmppStanza::Error &error)
| This signal is emitted when an error is encountered.
Q_SIGNAL void | joined ()
| This signal is emitted once you have joined the room.
Q_SIGNAL void | kicked (const QString &jid, const QString &reason)
| This signal is emitted if you get kicked from the room.
Q_SIGNAL void | left ()
| This signal is emitted once you have left the room.
Q_SIGNAL void | messageReceived (const QXmppMessage &message)
| This signal is emitted when a message is received.
Q_SIGNAL void | nameChanged (const QString &name)
| This signal is emitted when the room's human-readable name changes.
Q_SIGNAL void | nickNameChanged (const QString &nickName)
| This signal is emitted when your own nick name changes.
Q_SIGNAL void | participantAdded (const QString &jid)
| This signal is emitted when a participant joins the room.
Q_SIGNAL void | participantChanged (const QString &jid)
| This signal is emitted when a participant changes.
Q_SIGNAL void | participantRemoved (const QString &jid)
| This signal is emitted when a participant leaves the room.
Q_SIGNAL void | permissionsReceived (const QList< QXmppMucItem > &permissions)
| This signal is emitted when the room's permissions are received.
Q_SIGNAL void | subjectChanged (const QString &subject)
| This signal is emitted when the room's subject changes.
Q_SLOT bool | ban (const QString &jid, const QString &reason)
Q_SLOT bool | join ()
Q_SLOT bool | kick (const QString &jid, const QString &reason)
Q_SLOT bool | leave (const QString &message=QString())
Q_SLOT bool | requestConfiguration ()
Q_SLOT bool | requestPermissions ()
Q_SLOT bool | setConfiguration (const QXmppDataForm &form)
Q_SLOT bool | setPermissions (const QList< QXmppMucItem > &permissions)
Q_SLOT bool | sendInvitation (const QString &jid, const QString &reason)
Q_SLOT bool | sendMessage (const QString &text)

## Properties
QXmppMucRoom::Actions | allowedActions
| The actions you are allowed to perform on the room.
bool | isJoined
| Whether you are currently in the room.
QString | jid
| The chat room's bare JID.
QString | name
| The chat room's human-readable name.
QString | nickName
| Your own nickname.
QStringList | participants
| The list of participant JIDs.
QString | password
| The chat room password.
QString | subject
| The room's subject.

## Friends
class | QXmppMucManager

## Detailed Description

The QXmppMucRoom class represents a multi-user chat room as defined by XEP-0045: Multi-User Chat.

See also
  QXmppMucManager

## Member Enumeration Documentation

## ◆ Action

enum QXmppMucRoom::Action

This enum is used to describe chat room actions.

Enumerator
NoAction | no action
SubjectAction | change the room's subject
ConfigurationAction | change the room's configuration
PermissionsAction | change the room's permissions
KickAction | kick users from the room

## Member Function Documentation

## ◆ ban()

bool QXmppMucRoom::ban | ( | const QString & | jid,
|  | const QString & | reason )

Bans the specified user from the chat room.

The specified jid is the Bare JID of the form "user@host".

Returns
  true if the request was sent, false otherwise

## ◆ join()

bool QXmppMucRoom::join | ( |  | ) |

Joins the chat room.

Returns
  true if the request was sent, false otherwise

## ◆ kick()

bool QXmppMucRoom::kick | ( | const QString & | jid,
|  | const QString & | reason )

Kicks the specified user from the chat room.

The specified jid is the Occupant JID of the form "room@service/nick".

Returns
  true if the request was sent, false otherwise

## ◆ leave()

bool QXmppMucRoom::leave | ( | const QString & | message = QString() | ) |

Leaves the chat room.

Parameters

  message | An optional message.

Returns
  true if the request was sent, false otherwise

## ◆ name()

QString QXmppMucRoom::name | ( |  | ) | const

Returns the chat room's human-readable name.

This name will only be available after the room has been joined.

## ◆ participantFullJid()

QString QXmppMucRoom::participantFullJid | ( | const QString & | jid | ) | const

Returns the "Full JID" of the given participant.

The specified jid is the Occupant JID of the form "room@service/nick".

## ◆ participantPresence()

QXmppPresence QXmppMucRoom::participantPresence | ( | const QString & | jid | ) | const

Returns the presence for the given participant.

The specified jid is the Occupant JID of the form "room@service/nick".

## ◆ participants()

QStringList QXmppMucRoom::participants | ( |  | ) | const

Returns the list of participant JIDs.

These JIDs are Occupant JIDs of the form "room@service/nick".

## ◆ requestConfiguration()

bool QXmppMucRoom::requestConfiguration | ( |  | ) |

Request the configuration form for the chat room.

Returns
  true if the request was sent, false otherwise

See also
  configurationReceived()

## ◆ requestPermissions()

bool QXmppMucRoom::requestPermissions | ( |  | ) |

Request the room's permissions.

Returns
  true if the request was sent, false otherwise

See also
  permissionsReceived()

## ◆ sendInvitation()

bool QXmppMucRoom::sendInvitation | ( | const QString & | jid,
|  | const QString & | reason )

Invites a user to the chat room.

Parameters

  jid |
  reason |

Returns
  true if the request was sent, false otherwise

## ◆ sendMessage()

bool QXmppMucRoom::sendMessage | ( | const QString & | text | ) |

Sends a message to the room.

This is just a helper function, you can as well also send a message to the channel manually by setting the message type to 'groupchat' and addressing the JID of the MUC room.

Returns
  true if the request was sent, false otherwise

## ◆ setConfiguration()

bool QXmppMucRoom::setConfiguration | ( | const QXmppDataForm & | form | ) |

Send the configuration form for the chat room.

Parameters

  form |

Returns
  true if the request was sent, false otherwise

## ◆ setNickName()

void QXmppMucRoom::setNickName | ( | const QString & | nickName | ) |

Sets your own nickname.

You need to set your nickname before calling join().

Parameters

  nickName |

## ◆ setPassword()

void QXmppMucRoom::setPassword | ( | const QString & | password | ) |

Sets the chat room password.

Parameters

  password |

## ◆ setPermissions()

bool QXmppMucRoom::setPermissions | ( | const QList< QXmppMucItem > & | permissions | ) |

Sets the room's permissions.

Parameters

  permissions |

Returns
  true if the request was sent, false otherwise

## ◆ setSubject()

void QXmppMucRoom::setSubject | ( | const QString & | subject | ) |

Sets the chat room's subject.

Parameters

  subject |

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

- QXmppMucManager.h
- QXmppMucManager.cpp