diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2011-05-02 14:01:02 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2011-05-02 14:01:02 +0000 |
| commit | dc1f3d295d8f36122953435ca7a6d1b51deed14a (patch) | |
| tree | 2ece75dbcf4148e1991ba15d20c16d591730eb5f /src | |
| parent | ac9be1b32dad27209476d24249c734ca5aad66e5 (diff) | |
| download | qxmpp-dc1f3d295d8f36122953435ca7a6d1b51deed14a.tar.gz | |
make it possible to specify MUC leave message (fixes: #90)
Diffstat (limited to 'src')
| -rw-r--r-- | src/QXmppMucManager.cpp | 8 | ||||
| -rw-r--r-- | src/QXmppMucManager.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/QXmppMucManager.cpp b/src/QXmppMucManager.cpp index 8cb2c717..2794b6e5 100644 --- a/src/QXmppMucManager.cpp +++ b/src/QXmppMucManager.cpp @@ -266,13 +266,19 @@ bool QXmppMucRoom::kick(const QString &jid, const QString &reason) /// Leaves the chat room. /// +/// \param message An optional message. +/// /// \return true if the request was sent, false otherwise -bool QXmppMucRoom::leave() +bool QXmppMucRoom::leave(const QString &message) { QXmppPresence packet; packet.setTo(d->ownJid()); packet.setType(QXmppPresence::Unavailable); + + QXmppPresence::Status status; + status.setStatusText(message); + packet.setStatus(status); return d->client->sendPacket(packet); } diff --git a/src/QXmppMucManager.h b/src/QXmppMucManager.h index be439857..889364ca 100644 --- a/src/QXmppMucManager.h +++ b/src/QXmppMucManager.h @@ -168,7 +168,7 @@ signals: public slots: bool join(); bool kick(const QString &jid, const QString &reason); - bool leave(); + bool leave(const QString &message = QString()); bool requestConfiguration(); bool requestPermissions(); bool setConfiguration(const QXmppDataForm &form); |
