diff options
author | Black Hat <bhat@encom.eu.org> | 2019-09-26 22:22:36 -0700 |
---|---|---|
committer | Black Hat <bhat@encom.eu.org> | 2019-09-26 22:22:36 -0700 |
commit | 363cf452bcdbaf6ff1cf94a83ca66cbb31122346 (patch) | |
tree | c64c8fda885e4e1785130e8ee3e7c47fd18cbf67 /lib/joinstate.h | |
parent | 412e2cf19449e73aa7da729e9c5de6502687aade (diff) | |
parent | 944653463fe4134c82d85e2d01e2bc0fa43fd727 (diff) | |
download | libquotient-363cf452bcdbaf6ff1cf94a83ca66cbb31122346.tar.gz libquotient-363cf452bcdbaf6ff1cf94a83ca66cbb31122346.zip |
Merge branch 'master' of https://github.com/quotient-im/libQuotient into
bhat-libqtolm-update
Diffstat (limited to 'lib/joinstate.h')
-rw-r--r-- | lib/joinstate.h | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/lib/joinstate.h b/lib/joinstate.h index 4ae67de8..31c2b6a7 100644 --- a/lib/joinstate.h +++ b/lib/joinstate.h @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once @@ -22,27 +22,26 @@ #include <array> -namespace QMatrixClient -{ - enum class JoinState : unsigned int - { - Join = 0x1, - Invite = 0x2, - Leave = 0x4, - }; +namespace Quotient { +enum class JoinState : unsigned int { + Join = 0x1, + Invite = 0x2, + Leave = 0x4, +}; - Q_DECLARE_FLAGS(JoinStates, JoinState) +Q_DECLARE_FLAGS(JoinStates, JoinState) - // We cannot use REGISTER_ENUM outside of a Q_OBJECT and besides, we want - // to use strings that match respective JSON keys. - static const std::array<const char*, 3> JoinStateStrings - { { "join", "invite", "leave" } }; +// We cannot use Q_ENUM outside of a Q_OBJECT and besides, we want +// to use strings that match respective JSON keys. +static const std::array<const char*, 3> JoinStateStrings { { "join", "invite", + "leave" } }; - inline const char* toCString(JoinState js) - { - size_t state = size_t(js), index = 0; - while (state >>= 1u) ++index; - return JoinStateStrings[index]; - } -} // namespace QMatrixClient -Q_DECLARE_OPERATORS_FOR_FLAGS(QMatrixClient::JoinStates) +inline const char* toCString(JoinState js) +{ + size_t state = size_t(js), index = 0; + while (state >>= 1u) + ++index; + return JoinStateStrings[index]; +} +} // namespace Quotient +Q_DECLARE_OPERATORS_FOR_FLAGS(Quotient::JoinStates) |