Receive sharing intent

This commit is contained in:
Christian Pauly 2020-04-02 14:05:32 +02:00
commit 701c4d2757
11 changed files with 167 additions and 77 deletions

View file

@ -77,7 +77,16 @@ class ChatListItem extends StatelessWidget {
if (room.membership == Membership.join) {
if (Matrix.of(context).shareContent != null) {
unawaited(room.sendEvent(Matrix.of(context).shareContent));
if (Matrix.of(context).shareContent["msgtype"] ==
"chat.fluffy.shared_file") {
await Matrix.of(context).tryRequestWithErrorToast(
room.sendFileEvent(
Matrix.of(context).shareContent["file"],
),
);
} else {
unawaited(room.sendEvent(Matrix.of(context).shareContent));
}
Matrix.of(context).shareContent = null;
}
await Navigator.pushAndRemoveUntil(