mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-22 07:44:00 +01:00
Add report action for live location messages.
This commit is contained in:
parent
8fb6957bc0
commit
d8947f5c0b
@ -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
|
||||
|
@ -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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user