Merge pull request #6280 from vector-im/feature/ons/live_location_sharing_report

Add report action for live location messages [PSF-1067]
This commit is contained in:
Onuray Sahin 2022-06-13 14:23:11 +03:00 committed by GitHub
commit eb49ceb803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

1
changelog.d/6280.feature Normal file
View File

@ -0,0 +1 @@
Add report action for live location messages

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))
}