mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 03:16:02 +03:00
FastLane: Ignore message edition
This commit is contained in:
parent
7f7f90f89e
commit
4a0a6e9f01
2 changed files with 8 additions and 1 deletions
|
@ -289,3 +289,7 @@ fun Event.getRelationContent(): RelationDefaultContent? {
|
|||
fun Event.isReply(): Boolean {
|
||||
return getRelationContent()?.inReplyTo?.eventId != null
|
||||
}
|
||||
|
||||
fun Event.isEdition(): Boolean {
|
||||
return getRelationContent()?.takeIf { it.type == RelationType.REPLACE }?.eventId != null
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.matrix.android.sdk.api.session.content.ContentUrlResolver
|
|||
import org.matrix.android.sdk.api.session.crypto.MXCryptoError
|
||||
import org.matrix.android.sdk.api.session.events.model.Event
|
||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||
import org.matrix.android.sdk.api.session.events.model.isEdition
|
||||
import org.matrix.android.sdk.api.session.events.model.toModel
|
||||
import org.matrix.android.sdk.api.session.room.model.Membership
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomMemberContent
|
||||
|
@ -89,7 +90,9 @@ class NotifiableEventResolver @Inject constructor(
|
|||
fun resolveInMemoryEvent(session: Session, event: Event): NotifiableEvent? {
|
||||
if (event.getClearType() != EventType.MESSAGE) return null
|
||||
|
||||
// TODO Ignore message edition
|
||||
// Ignore message edition
|
||||
if (event.isEdition()) return null
|
||||
|
||||
val user = session.getUser(event.senderId!!) ?: return null
|
||||
|
||||
val timelineEvent = TimelineEvent(
|
||||
|
|
Loading…
Reference in a new issue