[WIP] Room-Verification Messages

This commit is contained in:
CH Chethan Reddy 2020-08-09 08:35:15 +05:30
parent 3635c185e9
commit 2e20049b36
15 changed files with 392 additions and 484 deletions

View file

@ -37,8 +37,15 @@ struct EventMsgType
template<class T>
mtx::events::MessageType operator()(const mtx::events::Event<T> &e)
{
if constexpr (is_detected<msgtype_t, T>::value)
return mtx::events::getMessageType(e.content.msgtype);
if constexpr (is_detected<msgtype_t, T>::value) {
if constexpr (std::is_same_v<std::optional<std::string>,
std::remove_cv_t<decltype(e.content.msgtype)>>)
return mtx::events::getMessageType(e.content.msgtype.value());
else if constexpr (std::is_same_v<
std::string,
std::remove_cv_t<decltype(e.content.msgtype)>>)
return mtx::events::getMessageType(e.content.msgtype);
}
return mtx::events::MessageType::Unknown;
}
};