Add report action for live location messages.

This commit is contained in:
Onuray Sahin 2022-06-10 14:01:43 +03:00
parent 8fb6957bc0
commit d8947f5c0b
2 changed files with 5 additions and 1 deletions

View File

@ -427,3 +427,6 @@ fun Event.getPollContent(): MessagePollContent? {
fun Event.supportsNotification() =
this.getClearType() in EventType.MESSAGE + EventType.POLL_START + EventType.STATE_ROOM_BEACON_INFO
fun Event.isContentReportable() =
this.getClearType() in EventType.MESSAGE + EventType.STATE_ROOM_BEACON_INFO

View File

@ -45,6 +45,7 @@ import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupState
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.isAttachmentMessage
import org.matrix.android.sdk.api.session.events.model.isContentReportable
import org.matrix.android.sdk.api.session.events.model.isTextMessage
import org.matrix.android.sdk.api.session.events.model.isThread
import org.matrix.android.sdk.api.session.events.model.toModel
@ -421,7 +422,7 @@ class MessageActionsViewModel @AssistedInject constructor(
add(EventSharedAction.CopyPermalink(eventId))
if (session.myUserId != timelineEvent.root.senderId) {
// not sent by me
if (timelineEvent.root.getClearType() == EventType.MESSAGE) {
if (timelineEvent.root.isContentReportable()) {
add(EventSharedAction.ReportContent(eventId, timelineEvent.root.senderId))
}