mirror of
https://github.com/krille-chan/fluffychat
synced 2024-08-11 09:13:44 +00:00
fix: Forward arbitrary message content
This commit is contained in:
parent
e95ed61257
commit
c67df2e14f
2 changed files with 23 additions and 5 deletions
|
@ -2409,5 +2409,12 @@
|
|||
"url": {},
|
||||
"error": {}
|
||||
}
|
||||
},
|
||||
"forwardMessageTo": "Forward message to {roomName}?",
|
||||
"@forwardMessageTo": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"roomName": {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -126,12 +126,23 @@ class ChatListItem extends StatelessWidget {
|
|||
);
|
||||
Matrix.of(context).shareContent = null;
|
||||
} else {
|
||||
final text = shareContent.tryGet<String>('body');
|
||||
Matrix.of(context).shareContent = null;
|
||||
context.go(
|
||||
'/rooms/${room.id}?body=$text',
|
||||
final consent = await showOkCancelAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context)!.forward,
|
||||
message: L10n.of(context)!.forwardMessageTo(
|
||||
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
|
||||
),
|
||||
okLabel: L10n.of(context)!.forward,
|
||||
cancelLabel: L10n.of(context)!.cancel,
|
||||
);
|
||||
return;
|
||||
if (consent == OkCancelResult.cancel) {
|
||||
Matrix.of(context).shareContent = null;
|
||||
return;
|
||||
}
|
||||
if (consent == OkCancelResult.ok) {
|
||||
room.sendEvent(shareContent);
|
||||
Matrix.of(context).shareContent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue