You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListEvents.kt
Copy file name to clipboardExpand all lines: features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListPresenter.kt
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ class ActionListPresenter @Inject constructor(
Copy file name to clipboardExpand all lines: features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ class TimelinePresenter @Inject constructor(
Copy file name to clipboardExpand all lines: features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineState.kt
Copy file name to clipboardExpand all lines: features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineStateProvider.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ fun aTimelineState(timelineItems: ImmutableList<TimelineItem> = persistentListOf
Copy file name to clipboardExpand all lines: features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemEventContent.kt
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,18 @@ fun TimelineItemEventContent.canBeCopied(): Boolean =
34
34
else->false
35
35
}
36
36
37
+
/**
38
+
* Determine if the event content can be replied to.
39
+
* Note: it should match the logic in [io.element.android.features.messages.impl.actionlist.ActionListPresenter].
40
+
*/
41
+
fun TimelineItemEventContent.canBeRepliedTo(): Boolean=
42
+
when (this) {
43
+
isTimelineItemRedactedContent,
44
+
isTimelineItemStateContent,
45
+
isTimelineItemPollContent->false
46
+
else->true
47
+
}
48
+
37
49
/**
38
50
* Return true if user can react (i.e. send a reaction) on the event content.
Copy file name to clipboardExpand all lines: features/messages/impl/src/test/kotlin/io/element/android/features/messages/actionlist/ActionListPresenterTest.kt
+45-14Lines changed: 45 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ class ActionListPresenterTest {
64
64
}.test {
65
65
val initialState = awaitItem()
66
66
val messageEvent = aMessageEvent(isMine =true, content =TimelineItemRedactedContent)
0 commit comments