forwardChatItems method
- ChatId from,
- ChatId to,
- List<
ChatItemQuoteInput> items, { - ChatMessageText? text,
- List<
AttachmentId> ? attachments,
Forwards ChatItems to the specified Chat by the authenticated MyUser.
Supported ChatItems are ChatMessage and ChatForward.
If text
or attachments
argument is specified, then the forwarded
ChatItems will be followed with a posted ChatMessage containing that
text
and/or attachments
.
Implementation
Future<void> forwardChatItems(
ChatId from,
ChatId to,
List<ChatItemQuoteInput> items, {
ChatMessageText? text,
List<AttachmentId>? attachments,
}) {
Log.debug(
'forwardChatItems($from, $to, $items, $text, $attachments)',
'$runtimeType',
);
if (text != null) {
text = ChatMessageText(text.val.trim());
}
return _chatRepository.forwardChatItems(
from,
to,
items,
text: text?.val.isEmpty == true ? null : text,
attachments: attachments,
);
}