MessageActions: disable if not synced atm
This commit is contained in:
parent
50bf6df7fe
commit
3196dcb57e
|
@ -17,11 +17,12 @@
|
||||||
package im.vector.riotx.core.extensions
|
package im.vector.riotx.core.extensions
|
||||||
|
|
||||||
import im.vector.matrix.android.api.session.events.model.EventType
|
import im.vector.matrix.android.api.session.events.model.EventType
|
||||||
|
import im.vector.matrix.android.api.session.room.send.SendState
|
||||||
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
|
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
|
||||||
|
|
||||||
fun TimelineEvent.canReact(): Boolean {
|
fun TimelineEvent.canReact(): Boolean {
|
||||||
// Only event of type Event.EVENT_TYPE_MESSAGE are supported for the moment
|
// Only event of type Event.EVENT_TYPE_MESSAGE are supported for the moment
|
||||||
return root.getClearType() == EventType.MESSAGE && root.sendState.isSent() && !root.isRedacted()
|
return root.getClearType() == EventType.MESSAGE && root.sendState == SendState.SYNCED && !root.isRedacted()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun TimelineEvent.displayReadMarker(myUserId: String): Boolean {
|
fun TimelineEvent.displayReadMarker(myUserId: String): Boolean {
|
||||||
|
|
|
@ -201,7 +201,7 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted
|
||||||
if (canCancel(event)) {
|
if (canCancel(event)) {
|
||||||
add(SimpleAction.Cancel(eventId))
|
add(SimpleAction.Cancel(eventId))
|
||||||
}
|
}
|
||||||
} else {
|
} else if (event.root.sendState == SendState.SYNCED) {
|
||||||
if (!event.root.isRedacted()) {
|
if (!event.root.isRedacted()) {
|
||||||
if (canReply(event, messageContent)) {
|
if (canReply(event, messageContent)) {
|
||||||
add(SimpleAction.Reply(eventId))
|
add(SimpleAction.Reply(eventId))
|
||||||
|
|
Loading…
Reference in New Issue