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:
commit
eb49ceb803
|
@ -0,0 +1 @@
|
||||||
|
Add report action for live location messages
|
|
@ -427,3 +427,6 @@ fun Event.getPollContent(): MessagePollContent? {
|
||||||
|
|
||||||
fun Event.supportsNotification() =
|
fun Event.supportsNotification() =
|
||||||
this.getClearType() in EventType.MESSAGE + EventType.POLL_START + EventType.STATE_ROOM_BEACON_INFO
|
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
|
||||||
|
|
|
@ -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.crypto.keysbackup.KeysBackupState
|
||||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
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.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.isTextMessage
|
||||||
import org.matrix.android.sdk.api.session.events.model.isThread
|
import org.matrix.android.sdk.api.session.events.model.isThread
|
||||||
import org.matrix.android.sdk.api.session.events.model.toModel
|
import org.matrix.android.sdk.api.session.events.model.toModel
|
||||||
|
@ -421,7 +422,7 @@ class MessageActionsViewModel @AssistedInject constructor(
|
||||||
add(EventSharedAction.CopyPermalink(eventId))
|
add(EventSharedAction.CopyPermalink(eventId))
|
||||||
if (session.myUserId != timelineEvent.root.senderId) {
|
if (session.myUserId != timelineEvent.root.senderId) {
|
||||||
// not sent by me
|
// not sent by me
|
||||||
if (timelineEvent.root.getClearType() == EventType.MESSAGE) {
|
if (timelineEvent.root.isContentReportable()) {
|
||||||
add(EventSharedAction.ReportContent(eventId, timelineEvent.root.senderId))
|
add(EventSharedAction.ReportContent(eventId, timelineEvent.root.senderId))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue