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:
zjs81 committed 2026-10-24 21:57:55 -07:00
1 parent 084a8fb98b
commit 34db64d7af
25 files changed
+315 -103

No files matched your search

+7 -2
View File
@@ -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',
);
},
);
}