mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Fix complexity error by extracting condition to a val.
This commit is contained in:
+4
-1
@@ -102,6 +102,9 @@ class ActionListPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is TimelineItemPollContent -> {
|
is TimelineItemPollContent -> {
|
||||||
|
val canEndPoll = timelineItem.isRemote &&
|
||||||
|
!timelineItem.content.isEnded &&
|
||||||
|
(timelineItem.isMine || canRedact)
|
||||||
buildList {
|
buildList {
|
||||||
if (timelineItem.isRemote) {
|
if (timelineItem.isRemote) {
|
||||||
// Can only reply or forward messages already uploaded to the server
|
// Can only reply or forward messages already uploaded to the server
|
||||||
@@ -110,7 +113,7 @@ class ActionListPresenter @Inject constructor(
|
|||||||
if (timelineItem.isRemote && timelineItem.isEditable) {
|
if (timelineItem.isRemote && timelineItem.isEditable) {
|
||||||
add(TimelineItemAction.Edit)
|
add(TimelineItemAction.Edit)
|
||||||
}
|
}
|
||||||
if (timelineItem.isRemote && !timelineItem.content.isEnded && (timelineItem.isMine || canRedact)) {
|
if (canEndPoll) {
|
||||||
add(TimelineItemAction.EndPoll)
|
add(TimelineItemAction.EndPoll)
|
||||||
}
|
}
|
||||||
if (timelineItem.content.canBeCopied()) {
|
if (timelineItem.content.canBeCopied()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user