-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add joinrule api and joinrulesevent #616
base: dev
Are you sure you want to change the base?
Conversation
f08e95f
to
b67568f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes will be needed before moving forward.
class JoinRulesEvent : public StateEvent { | ||
public: | ||
QUO_EVENT(JoinRulesEvent, "m.room.join_rules") | ||
|
||
explicit JoinRulesEvent(const QJsonObject& obj) : StateEvent(obj) {} | ||
|
||
QString joinRule() const; | ||
QJsonArray allow() const; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rather basic implementation of m.room.join_rules
, missing the safeguards that I would expect it to have. At the very least, joinRule
should be an enum (hopefully we don't get a tide of new join rules in the next year, as we've just added a bunch). Even better, allow
could actually be made a vector of AllowCondition
structures defined in the spec. I realise this is more work than just copying code from NeoChat - if you don't feel like doing it, let me know and I will help.
b67568f
to
3db0272
Compare
I'll take this over if you don't mind. |
Thanks |
add joinrule, code from neochat