Implement forwarding messages

This commit is contained in:
Christian Pauly
2020-01-17 11:37:02 +01:00
parent bd36e3039e
commit 72dce3ac1d
4 changed files with 72 additions and 36 deletions

View File

@ -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,