Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add report action for live location messages [PSF-1067] #6280

Merged
merged 2 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/6280.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add report action for live location messages
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}

Expand Down