RtcNotificationContent class
The content of an MSC4075 RTC notification event.
This is a data class representing the RTC-specific fields of the event. For mentions use Event.mentions and related member event use id use Event.relationshipEventId of the respective event.
Constructors
- RtcNotificationContent({required DateTime senderTs, required RtcNotificationType notificationType, Duration lifetime = defaultLifetime})
-
const
- RtcNotificationContent.create({required RtcNotificationType type, Duration lifetime = defaultLifetime})
-
factory
- RtcNotificationContent.fromEvent(Event event)
-
factory
Properties
- cappedLifetime → Duration
-
Returns the capped lifetime, ensuring it doesn't exceed maxLifetime
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- lifetime → Duration
-
The relative time to sender_ts for which the notification is active
final
- notificationType → RtcNotificationType
-
The type of notification (ring or notification)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- senderTs → DateTime
-
The local timestamp observed by the sender device
final
Methods
-
getEffectiveTimestamp(
DateTime originServerTs) → DateTime - Returns the effective timestamp, falling back to origin_server_ts if needed
-
isExpired(
DateTime originServerTs) → bool - Checks if this notification has expired
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldNotifyUser(
{required Event event, required String currentUserId, bool isAlreadyRinging = false}) → bool - Validates that this RTC notification event should cause the client to notify the user according to MSC4075 rules.
-
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultLifetime → const Duration
- The default lifetime for notifications (30 seconds)
- eventType → const String
- maxLifetime → const Duration
- The maximum recommended lifetime (2 minutes)
- maxTimestampDeviation → const Duration
- Max deviation between sender_ts and origin_server_ts before fallback (20s)