Skip to content

Commit 2962032

Browse files
committed
Move InReplyTo to its own file.
1 parent 7c6397d commit 2962032

File tree

2 files changed

+47
-28
lines changed

2 files changed

+47
-28
lines changed

libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/timeline/item/event/EventContent.kt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package io.element.android.libraries.matrix.api.timeline.item.event
1818

19-
import io.element.android.libraries.matrix.api.core.EventId
2019
import io.element.android.libraries.matrix.api.core.UserId
2120
import io.element.android.libraries.matrix.api.media.AudioInfo
2221
import io.element.android.libraries.matrix.api.media.FileInfo
@@ -36,33 +35,6 @@ data class MessageContent(
3635
val type: MessageType?
3736
) : EventContent
3837

39-
sealed interface InReplyTo {
40-
/** The event details are not loaded yet. We can fetch them. */
41-
data class NotLoaded(val eventId: EventId) : InReplyTo
42-
43-
/** The event details are pending to be fetched. We should **not** fetch them again. */
44-
data object Pending : InReplyTo
45-
46-
/** The event details are available. */
47-
data class Ready(
48-
val eventId: EventId,
49-
val content: EventContent,
50-
val senderId: UserId,
51-
val senderDisplayName: String?,
52-
val senderAvatarUrl: String?,
53-
) : InReplyTo
54-
55-
/**
56-
* Fetching the event details failed.
57-
*
58-
* We can try to fetch them again **with a proper retry strategy**, but not blindly:
59-
*
60-
* If the reason for the failure is consistent on the server, we'd enter a loop
61-
* where we keep trying to fetch the same event.
62-
* */
63-
data object Error : InReplyTo
64-
}
65-
6638
data object RedactedContent : EventContent
6739

6840
data class StickerContent(
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) 2023 New Vector Ltd
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.element.android.libraries.matrix.api.timeline.item.event
18+
19+
import io.element.android.libraries.matrix.api.core.EventId
20+
import io.element.android.libraries.matrix.api.core.UserId
21+
22+
sealed interface InReplyTo {
23+
/** The event details are not loaded yet. We can fetch them. */
24+
data class NotLoaded(val eventId: EventId) : InReplyTo
25+
26+
/** The event details are pending to be fetched. We should **not** fetch them again. */
27+
data object Pending : InReplyTo
28+
29+
/** The event details are available. */
30+
data class Ready(
31+
val eventId: EventId,
32+
val content: EventContent,
33+
val senderId: UserId,
34+
val senderDisplayName: String?,
35+
val senderAvatarUrl: String?,
36+
) : InReplyTo
37+
38+
/**
39+
* Fetching the event details failed.
40+
*
41+
* We can try to fetch them again **with a proper retry strategy**, but not blindly:
42+
*
43+
* If the reason for the failure is consistent on the server, we'd enter a loop
44+
* where we keep trying to fetch the same event.
45+
* */
46+
data object Error : InReplyTo
47+
}

0 commit comments

Comments
 (0)