mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 09:35:12 +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": {},
|
"url": {},
|
||||||
"error": {}
|
"error": {}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"forwardMessageTo": "Forward message to {roomName}?",
|
||||||
|
"@forwardMessageTo": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {
|
||||||
|
"roomName": {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -126,12 +126,23 @@ class ChatListItem extends StatelessWidget {
|
||||||
);
|
);
|
||||||
Matrix.of(context).shareContent = null;
|
Matrix.of(context).shareContent = null;
|
||||||
} else {
|
} else {
|
||||||
final text = shareContent.tryGet<String>('body');
|
final consent = await showOkCancelAlertDialog(
|
||||||
Matrix.of(context).shareContent = null;
|
context: context,
|
||||||
context.go(
|
title: L10n.of(context)!.forward,
|
||||||
'/rooms/${room.id}?body=$text',
|
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