Implement forwarding messages
This commit is contained in:
parent
bd36e3039e
commit
72dce3ac1d
4 changed files with 72 additions and 36 deletions
|
|
@ -72,6 +72,15 @@ class Message extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
if (!event.redacted) {
|
||||
popupMenuList.add(
|
||||
const PopupMenuItem<String>(
|
||||
value: "forward",
|
||||
child: Text('Forward'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (ownMessage && event.status == -1) {
|
||||
popupMenuList.add(
|
||||
const PopupMenuItem<String>(
|
||||
|
|
@ -108,6 +117,10 @@ class Message extends StatelessWidget {
|
|||
case "copy":
|
||||
await Clipboard.setData(ClipboardData(text: event.body));
|
||||
break;
|
||||
case "forward":
|
||||
Matrix.of(context).shareContent = event.content;
|
||||
Navigator.of(context).popUntil((r) => r.isFirst);
|
||||
break;
|
||||
}
|
||||
},
|
||||
itemBuilder: (BuildContext context) => popupMenuList,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue