@@ -343,24 +343,6 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted
343
343
add(EventSharedAction .Edit (eventId, timelineEvent.root.getClearType()))
344
344
}
345
345
346
- if (canRedact(timelineEvent, actionPermissions)) {
347
- if (timelineEvent.root.getClearType() == EventType .POLL_START ) {
348
- add(EventSharedAction .Redact (
349
- eventId,
350
- askForReason = informationData.senderId != session.myUserId,
351
- dialogTitleRes = R .string.delete_poll_dialog_title,
352
- dialogDescriptionRes = R .string.delete_poll_dialog_content
353
- ))
354
- } else {
355
- add(EventSharedAction .Redact (
356
- eventId,
357
- askForReason = informationData.senderId != session.myUserId,
358
- dialogTitleRes = R .string.delete_event_dialog_title,
359
- dialogDescriptionRes = R .string.delete_event_dialog_content
360
- ))
361
- }
362
- }
363
-
364
346
if (canCopy(msgType)) {
365
347
// TODO copy images? html? see ClipBoard
366
348
add(EventSharedAction .Copy (messageContent!! .body))
@@ -382,12 +364,30 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted
382
364
add(EventSharedAction .ViewEditHistory (informationData))
383
365
}
384
366
367
+ if (canSave(msgType) && messageContent is MessageWithAttachmentContent ) {
368
+ add(EventSharedAction .Save (timelineEvent.eventId, messageContent))
369
+ }
370
+
385
371
if (canShare(msgType)) {
386
372
add(EventSharedAction .Share (timelineEvent.eventId, messageContent!! ))
387
373
}
388
374
389
- if (canSave(msgType) && messageContent is MessageWithAttachmentContent ) {
390
- add(EventSharedAction .Save (timelineEvent.eventId, messageContent))
375
+ if (canRedact(timelineEvent, actionPermissions)) {
376
+ if (timelineEvent.root.getClearType() == EventType .POLL_START ) {
377
+ add(EventSharedAction .Redact (
378
+ eventId,
379
+ askForReason = informationData.senderId != session.myUserId,
380
+ dialogTitleRes = R .string.delete_poll_dialog_title,
381
+ dialogDescriptionRes = R .string.delete_poll_dialog_content
382
+ ))
383
+ } else {
384
+ add(EventSharedAction .Redact (
385
+ eventId,
386
+ askForReason = informationData.senderId != session.myUserId,
387
+ dialogTitleRes = R .string.delete_event_dialog_title,
388
+ dialogDescriptionRes = R .string.delete_event_dialog_content
389
+ ))
390
+ }
391
391
}
392
392
}
393
393
0 commit comments