@@ -47,6 +47,7 @@ use ruma::{
4747 tombstone:: RoomTombstoneEventContent ,
4848 topic:: RoomTopicEventContent ,
4949 } ,
50+ rtc:: notification:: CallIntent ,
5051 space:: { child:: SpaceChildEventContent , parent:: SpaceParentEventContent } ,
5152 sticker:: StickerEventContent ,
5253 } ,
@@ -121,7 +122,10 @@ pub enum TimelineItemContent {
121122 CallInvite ,
122123
123124 /// An `m.rtc.notification` event
124- RtcNotification ,
125+ RtcNotification {
126+ /// The intent of this notification.
127+ call_intent : Option < CallIntent > ,
128+ } ,
125129}
126130
127131impl TimelineItemContent {
@@ -146,7 +150,7 @@ impl TimelineItemContent {
146150 Self :: FailedToParseMessageLike { event_type, .. } => Some ( event_type. to_string ( ) ) ,
147151 Self :: FailedToParseState { event_type, .. } => Some ( event_type. to_string ( ) ) ,
148152 Self :: CallInvite => Some ( MessageLikeEventType :: CallInvite . to_string ( ) ) ,
149- Self :: RtcNotification => Some ( MessageLikeEventType :: RtcNotification . to_string ( ) ) ,
153+ Self :: RtcNotification { .. } => Some ( MessageLikeEventType :: RtcNotification . to_string ( ) ) ,
150154 }
151155 }
152156
@@ -330,7 +334,7 @@ impl TimelineItemContent {
330334 TimelineItemContent :: FailedToParseMessageLike { .. }
331335 | TimelineItemContent :: FailedToParseState { .. } => "an event that couldn't be parsed" ,
332336 TimelineItemContent :: CallInvite => "a call invite" ,
333- TimelineItemContent :: RtcNotification => "a call notification" ,
337+ TimelineItemContent :: RtcNotification { .. } => "a call notification" ,
334338 }
335339 }
336340
@@ -401,7 +405,7 @@ impl TimelineItemContent {
401405
402406 pub ( in crate :: timeline) fn redact ( & self , rules : & RedactionRules ) -> Self {
403407 match self {
404- Self :: MsgLike ( _) | Self :: CallInvite | Self :: RtcNotification => {
408+ Self :: MsgLike ( _) | Self :: CallInvite | Self :: RtcNotification { .. } => {
405409 TimelineItemContent :: MsgLike ( MsgLikeContent :: redacted ( ) )
406410 }
407411 Self :: MembershipChange ( ev) => Self :: MembershipChange ( ev. redact ( rules) ) ,
@@ -433,7 +437,7 @@ impl TimelineItemContent {
433437 | TimelineItemContent :: FailedToParseMessageLike { .. }
434438 | TimelineItemContent :: FailedToParseState { .. }
435439 | TimelineItemContent :: CallInvite
436- | TimelineItemContent :: RtcNotification => {
440+ | TimelineItemContent :: RtcNotification { .. } => {
437441 // No reactions for these kind of items.
438442 None
439443 }
@@ -458,7 +462,7 @@ impl TimelineItemContent {
458462 | TimelineItemContent :: FailedToParseMessageLike { .. }
459463 | TimelineItemContent :: FailedToParseState { .. }
460464 | TimelineItemContent :: CallInvite
461- | TimelineItemContent :: RtcNotification => {
465+ | TimelineItemContent :: RtcNotification { .. } => {
462466 // No reactions for these kind of items.
463467 None
464468 }
0 commit comments