Click on redacted event
This commit is contained in:
parent
fe69206340
commit
3625c462f0
@ -5,7 +5,7 @@ Features:
|
|||||||
-
|
-
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
-
|
- Handle click on redacted events: view source and create permalink
|
||||||
|
|
||||||
Other changes:
|
Other changes:
|
||||||
-
|
-
|
||||||
|
@ -21,5 +21,5 @@ 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 && sendState.isSent()
|
return root.getClearType() == EventType.MESSAGE && sendState.isSent() && !root.isRedacted()
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,7 @@ class MessageMenuViewModel @AssistedInject constructor(@Assisted initialState: M
|
|||||||
}
|
}
|
||||||
//TODO is downloading attachement?
|
//TODO is downloading attachement?
|
||||||
|
|
||||||
|
if (!event.root.isRedacted()) {
|
||||||
if (event.canReact()) {
|
if (event.canReact()) {
|
||||||
this.add(SimpleAction(ACTION_ADD_REACTION, R.string.message_add_reaction, R.drawable.ic_add_reaction, eventId))
|
this.add(SimpleAction(ACTION_ADD_REACTION, R.string.message_add_reaction, R.drawable.ic_add_reaction, eventId))
|
||||||
}
|
}
|
||||||
@ -172,6 +173,7 @@ class MessageMenuViewModel @AssistedInject constructor(@Assisted initialState: M
|
|||||||
|
|
||||||
//TODO sent by me or sufficient power level
|
//TODO sent by me or sufficient power level
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.add(SimpleAction(VIEW_SOURCE, R.string.view_source, R.drawable.ic_view_source, event.root.toContentStringWithIndent()))
|
this.add(SimpleAction(VIEW_SOURCE, R.string.view_source, R.drawable.ic_view_source, event.root.toContentStringWithIndent()))
|
||||||
if (event.isEncrypted()) {
|
if (event.isEncrypted()) {
|
||||||
|
@ -417,6 +417,14 @@ class MessageItemFactory @Inject constructor(
|
|||||||
.informationData(informationData)
|
.informationData(informationData)
|
||||||
.highlighted(highlight)
|
.highlighted(highlight)
|
||||||
.avatarCallback(callback)
|
.avatarCallback(callback)
|
||||||
|
.cellClickListener(
|
||||||
|
DebouncedClickListener(View.OnClickListener { view ->
|
||||||
|
callback?.onEventCellClicked(informationData, null, view)
|
||||||
|
}))
|
||||||
|
.longClickListener { view ->
|
||||||
|
return@longClickListener callback?.onEventLongClicked(informationData, null, view)
|
||||||
|
?: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun linkifyBody(body: CharSequence, callback: TimelineEventController.Callback?): CharSequence {
|
private fun linkifyBody(body: CharSequence, callback: TimelineEventController.Callback?): CharSequence {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user