Merge branch 'soru/fix-wrong-event-copied' into 'main'

fix: Copying an event did not obey edits

See merge request ChristianPauly/fluffychat-flutter!284
This commit is contained in:
Christian Pauly 2020-11-21 19:06:33 +00:00
commit ad824803d5

View File

@ -301,11 +301,13 @@ class _ChatState extends State<_Chat> {
var copyString = ''; var copyString = '';
if (selectedEvents.length == 1) { if (selectedEvents.length == 1) {
return selectedEvents.first return selectedEvents.first
.getDisplayEvent(timeline)
.getLocalizedBody(MatrixLocals(L10n.of(context))); .getLocalizedBody(MatrixLocals(L10n.of(context)));
} }
for (var event in selectedEvents) { for (var event in selectedEvents) {
if (copyString.isNotEmpty) copyString += '\n\n'; if (copyString.isNotEmpty) copyString += '\n\n';
copyString += event.getLocalizedBody(MatrixLocals(L10n.of(context)), copyString += event.getDisplayEvent(timeline).getLocalizedBody(
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: true); withSenderNamePrefix: true);
} }
return copyString; return copyString;