File tree Expand file tree Collapse file tree
src/main/java/io/github/hikingc/matrixsdk/api/events Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import com .fasterxml .jackson .annotation .JsonInclude ;
44import com .fasterxml .jackson .annotation .JsonTypeInfo ;
5+ import io .github .hikingc .matrixsdk .api .events .server .UnknownEvent ;
56import io .github .hikingc .matrixsdk .api .identifiers .EventID ;
67import io .github .hikingc .matrixsdk .api .identifiers .RoomID ;
78import io .github .hikingc .matrixsdk .api .identifiers .UserID ;
1415/// @see <a href="https://spec.matrix.org/latest/client-server-api/#room-event-format">The room
1516/// event format as defined in the specification.</a>
1617@ JsonInclude (JsonInclude .Include .NON_ABSENT )
17- @ JsonTypeInfo (use = JsonTypeInfo .Id .NAME , include = JsonTypeInfo .As .PROPERTY , property = "type" )
18+ @ JsonTypeInfo (
19+ use = JsonTypeInfo .Id .NAME ,
20+ include = JsonTypeInfo .As .PROPERTY ,
21+ property = "type" ,
22+ defaultImpl = UnknownEvent .class )
1823// This interface CANNOT permit anything other than these two.
19- public sealed interface ClientEvent <T > permits StateEvent , MessageEvent {
24+ public sealed interface ClientEvent <T > permits StateEvent , MessageEvent , UnknownEvent {
2025
2126 /// @return the body of this event, as created by the user which sent it.
2227 T content ();
Original file line number Diff line number Diff line change 1+ package io .github .hikingc .matrixsdk .api .events .server ;
2+
3+ import io .github .hikingc .matrixsdk .api .events .ClientEvent ;
4+ import io .github .hikingc .matrixsdk .api .events .UnsignedData ;
5+ import io .github .hikingc .matrixsdk .api .identifiers .EventID ;
6+ import io .github .hikingc .matrixsdk .api .identifiers .RoomID ;
7+ import io .github .hikingc .matrixsdk .api .identifiers .UserID ;
8+
9+ public record UnknownEvent (
10+ Object content ,
11+ EventID eventId ,
12+ Long originServerTs ,
13+ RoomID roomId ,
14+ UserID sender ,
15+ String type ,
16+ UnsignedData unsigned )
17+ implements ClientEvent <Object > {}
You can’t perform that action at this time.
0 commit comments