diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-01-04 01:30:03 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-01-04 01:59:36 +0100 |
commit | e840704b58a984351971e8034e74f5e9fdfaf114 (patch) | |
tree | 9b038d0003e175b640cddd8de0d7814dde8eaf51 /src/bridge/bridge.cpp | |
parent | baf03a7e20d30698a06ccf03cd93b15317de340e (diff) | |
download | biboumi-e840704b58a984351971e8034e74f5e9fdfaf114.tar.gz biboumi-e840704b58a984351971e8034e74f5e9fdfaf114.tar.bz2 biboumi-e840704b58a984351971e8034e74f5e9fdfaf114.tar.xz biboumi-e840704b58a984351971e8034e74f5e9fdfaf114.zip |
Convert received modes into roles and affiliations
Diffstat (limited to 'src/bridge/bridge.cpp')
-rw-r--r-- | src/bridge/bridge.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index fb3afc7..d034bcd 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -225,3 +225,35 @@ void Bridge::send_nickname_conflict_error(const Iid& iid, const std::string& nic { this->xmpp->send_nickname_conflict_error(iid.chan + "%" + iid.server, nickname, this->user_jid); } + +void Bridge::send_affiliation_role_change(const Iid& iid, const std::string& target, const char mode) +{ + std::string role; + std::string affiliation; + if (mode == 0) + { + role = "participant"; + affiliation = "none"; + } + else if (mode == 'a') + { + role = "moderator"; + affiliation = "owner"; + } + else if (mode == 'o') + { + role = "moderator"; + affiliation = "admin"; + } + else if (mode == 'h') + { + role = "moderator"; + affiliation = "member"; + } + else if (mode == 'v') + { + role = "participant"; + affiliation = "member"; + } + this->xmpp->send_affiliation_role_change(iid.chan + "%" + iid.server, target, affiliation, role, this->user_jid); +} |