-
-
Notifications
You must be signed in to change notification settings - Fork 162
Revert " Remove event_enum! and only use event_content_enum" #68
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
Conversation
This reverts commit 2a91dc1.
Move EventDeHelper and from_raw_json_value to lib make pub so event_enum! macro can use them and test. to_camel_case returns a syn::Result.
|
||
/// Any message event. | ||
pub type AnyMessageEvent = MessageEvent<AnyMessageEventContent>; | ||
|
||
/// Any message event stub (message event without a `room_id`, as returned in `/sync` responses) | ||
pub type AnyMessageEventStub = MessageEventStub<AnyMessageEventContent>; |
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.
Ah, I guess we do need the marker trait implementations... For now.
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.
Are we planning on removing the Any*EventContent
enums? An event that has a prev_content
is still possible right?
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.
The Any*EventContent
enums are needed when sending events. I don't think they're needed as the C
in GenericEvent<C>
though.
ruma-events/tests/state_event.rs
Outdated
@@ -236,3 +236,48 @@ fn deserialize_avatar_without_prev_content() { | |||
&& unsigned.is_empty() | |||
); | |||
} | |||
|
|||
#[test] | |||
fn deserialize_member_event_membership_hoist_unsigned_prev_content() { |
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.
Side question (maybe unclear to me bc. English is not my first language): What does 'hoist' mean here?
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.
Instead of membership being in the content
field it's at the top-level, "lifted" out.
Would deserialize_member_event_with_top_level_membership_field
be better since the prev_content part isn't actually important to why it was failing?
Clean up imports and test names for state_event
No description provided.