|
|
|
@ -35,7 +35,13 @@ data class MessageContent(
@@ -35,7 +35,13 @@ data class MessageContent(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sealed interface InReplyTo { |
|
|
|
|
/** The event details are not loaded yet. We can fetch them. */ |
|
|
|
|
data class NotLoaded(val eventId: EventId) : InReplyTo |
|
|
|
|
|
|
|
|
|
/** The event details are pending to be fetched. We should **not** fetch them again. */ |
|
|
|
|
object Pending : InReplyTo |
|
|
|
|
|
|
|
|
|
/** The event details are available. */ |
|
|
|
|
data class Ready( |
|
|
|
|
val eventId: EventId, |
|
|
|
|
val content: MessageContent, |
|
|
|
@ -44,6 +50,14 @@ sealed interface InReplyTo {
@@ -44,6 +50,14 @@ sealed interface InReplyTo {
|
|
|
|
|
val senderAvatarUrl: String?, |
|
|
|
|
) : InReplyTo |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Fetching the event details failed. |
|
|
|
|
* |
|
|
|
|
* We can try to fetch them again **with a proper retry strategy**, but not blindly: |
|
|
|
|
* |
|
|
|
|
* If the reason for the failure is consistent on the server, we'd enter a loop |
|
|
|
|
* where we keep trying to fetch the same event. |
|
|
|
|
* */ |
|
|
|
|
object Error : InReplyTo |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|