Never silently truncate the draft when attaching an IPFS link
Check before uploading that the link (from the gateway and a CIDv1-sized placeholder) fits with the draft and the reply prefix, and tell the user when it doesn't instead of cutting their text. The channel limit now counts the @[name] reply prefix like the send path.
This commit is contained in:
1 parent
084a8fb98b
commit
34db64d7af
25 files changed
+315
-103
No files matched your search
@@ -1319,8 +1319,13 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
controller: _textController,
|
||||
focusNode: _textFieldFocusNode,
|
||||
maxBytes: maxChannelMessageBytes(connector.selfName),
|
||||
encodeOutbound: (text) =>
|
||||
connector.prepareChannelOutboundText(widget.channel.index, text),
|
||||
encodeOutbound: (text) {
|
||||
final replyTo = _replyingToMessage;
|
||||
return connector.prepareChannelOutboundText(
|
||||
widget.channel.index,
|
||||
replyTo == null ? text : '${_replyPrefix(replyTo)}$text',
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user