Fix / sending poll event appears forever

This commit is contained in:
Valere 2020-09-03 11:06:39 +02:00 committed by Benoit Marty
parent 3755d866b1
commit eb5088c699

View File

@ -317,6 +317,8 @@ internal class DefaultTimeline(
@Subscribe(threadMode = ThreadMode.MAIN)
fun onLocalEchoCreated(onLocalEchoCreated: OnLocalEchoCreated) {
if (isLive && onLocalEchoCreated.roomId == roomId) {
// do not add events that would have been filtered
if (listOf(onLocalEchoCreated.timelineEvent).filterEventsWithSettings().isNotEmpty()) {
listeners.forEach {
it.onNewTimelineEvents(listOf(onLocalEchoCreated.timelineEvent.eventId))
}
@ -325,6 +327,7 @@ internal class DefaultTimeline(
postSnapshot()
}
}
}
// Private methods *****************************************************************************
@ -778,7 +781,7 @@ internal class DefaultTimeline(
val filterEdits = if (settings.filterEdits && it.root.type == EventType.MESSAGE) {
val messageContent = it.root.content.toModel<MessageContent>()
messageContent?.relatesTo?.type != RelationType.REPLACE
messageContent?.relatesTo?.type != RelationType.REPLACE && messageContent?.relatesTo?.type != RelationType.RESPONSE
} else {
true
}