diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-02-27 22:45:32 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-03-06 20:25:01 (GMT) |
commit | 27d21b371f24272466a2d6a5bf2e2b717ee2d9fc (patch) | |
tree | 5f53281711d4f467933e4b3315241e4eee58a64c /Swiftob/Users.h | |
parent | d9c9df3b4ae5432552417fc4db74d62ab34f066d (diff) | |
download | swift-contrib-27d21b371f24272466a2d6a5bf2e2b717ee2d9fc.zip swift-contrib-27d21b371f24272466a2d6a5bf2e2b717ee2d9fc.tar.bz2 |
A start on Swiftob, a Swiften-based chatbot.
Diffstat (limited to 'Swiftob/Users.h')
-rw-r--r-- | Swiftob/Users.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Swiftob/Users.h b/Swiftob/Users.h new file mode 100644 index 0000000..0acc330 --- /dev/null +++ b/Swiftob/Users.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011 Kevin Smith + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <vector> +#include <string> + +#include <Swiften/JID/JID.h> +#include <Swiften/Elements/Message.h> + +namespace Swift { +class Client; +} + +class MUCs; + +using namespace Swift; + +class Users { + public: + class User { + public: + /* If you add a role here, edit the role lists in Commands.cpp*/ + enum Role {Unknown, Owner}; + User(const JID& jid, Role role) : jid_(jid), role_(role) {} + Role getRole() {return role_;} + Swift::JID getJID() {return jid_;} + private: + Swift::JID jid_; + Role role_; + }; + + public: + Users(Client* client, MUCs* mucs); + void clearAll(); + void addUser(const User& user); + User::Role getRoleForSender(Message::ref message); + + private: + std::vector<User> users_; + Client* client_; + MUCs* mucs_; +}; + + |