diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-09-26 14:27:49 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-09-26 14:27:49 (GMT) |
commit | 2680416456d722a4779322949f6ed230de3d422b (patch) | |
tree | 7ed7f79ead222adbe0d978376967d9b508d5068f /Swiften/MUC | |
parent | 101053d01cf2274e8eb75c520cce0bfee4d15618 (diff) | |
download | swift-2680416456d722a4779322949f6ed230de3d422b.zip swift-2680416456d722a4779322949f6ed230de3d422b.tar.bz2 |
Allow setting of room topics
Diffstat (limited to 'Swiften/MUC')
-rw-r--r-- | Swiften/MUC/MUC.cpp | 9 | ||||
-rw-r--r-- | Swiften/MUC/MUC.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp index 4b3960f..59917f9 100644 --- a/Swiften/MUC/MUC.cpp +++ b/Swiften/MUC/MUC.cpp @@ -15,6 +15,7 @@ #include <Swiften/Client/StanzaChannel.h> #include <Swiften/Queries/IQRouter.h> #include <Swiften/Elements/Form.h> +#include <Swiften/Elements/Message.h> #include <Swiften/Elements/IQ.h> #include <Swiften/Elements/MUCUserPayload.h> #include <Swiften/Elements/MUCAdminPayload.h> @@ -235,6 +236,14 @@ void MUC::handleKickResponse(MUCAdminPayload::ref /*unused*/, ErrorPayload::ref } } +void MUC::changeSubject(const std::string& subject) { + Message::ref message = boost::make_shared<Message>(); + message->setSubject(subject); + message->setType(Message::Groupchat); + message->setTo(ownMUCJID.toBare()); + stanzaChannel->sendMessage(message); +} + //FIXME: Recognise Topic changes //TODO: Invites(direct/mediated) diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h index 41dbc4a..26247c5 100644 --- a/Swiften/MUC/MUC.h +++ b/Swiften/MUC/MUC.h @@ -56,6 +56,7 @@ namespace Swift { MUCOccupant getOccupant(const std::string& nick); bool hasOccupant(const std::string& nick); void kickUser(const JID& jid); + void changeSubject(const std::string& subject); public: boost::signal<void (const std::string& /*nick*/)> onJoinComplete; boost::signal<void (ErrorPayload::ref)> onJoinFailed; |