Upgrade Cwtch and Display Message Limits
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Sarah Jamie Lewis 2022-01-26 12:25:03 -08:00
parent c672574bb2
commit 5c76628578
4 changed files with 18 additions and 5 deletions

View File

@ -1 +1 @@
2022-01-20-17-22-v1.5.4-16-ge0e1a4b
2022-01-26-15-10-v1.5.4-18-gd77d7bb

View File

@ -1 +1 @@
2022-01-20-22-22-v1.5.4-16-ge0e1a4b
2022-01-26-20-10-v1.5.4-18-gd77d7bb

View File

@ -63,8 +63,7 @@ NotificationsManager newDesktopNotificationsManager() {
client.getCapabilities();
return LinuxNotificationsManager(client);
} catch (e) {
EnvironmentConfig.debugLog(
"Attempted to access DBUS for notifications but failed. Switching off notifications.");
EnvironmentConfig.debugLog("Attempted to access DBUS for notifications but failed. Switching off notifications.");
}
} else if (Platform.isWindows) {
try {

View File

@ -175,8 +175,19 @@ class _MessageViewState extends State<MessageView> {
));
}
// todo: legacy groups currently have restricted message
// size because of the additional wrapping end encoding
// hybrid groups should allow these numbers to be the same.
static const P2PMessageLengthMax = 7000;
static const GroupMessageLengthMax = 1800;
void _sendMessage([String? ignoredParam]) {
if (ctrlrCompose.value.text.isNotEmpty) {
var isGroup = Provider.of<ProfileInfoState>(context).contactList.getContact(Provider.of<AppState>(context, listen: false).selectedConversation!)!.isGroup;
// peers and groups currently have different length constraints (servers can store less)...
var lengthOk = (isGroup && ctrlrCompose.value.text.length < GroupMessageLengthMax) || ctrlrCompose.value.text.length <= P2PMessageLengthMax;
if (ctrlrCompose.value.text.isNotEmpty && lengthOk) {
if (Provider.of<AppState>(context, listen: false).selectedConversation != null && Provider.of<AppState>(context, listen: false).selectedIndex != null) {
Provider.of<FlwtchState>(context, listen: false)
.cwtch
@ -237,6 +248,7 @@ class _MessageViewState extends State<MessageView> {
Widget _buildComposeBox() {
bool isOffline = Provider.of<ContactInfoState>(context).isOnline() == false;
bool isGroup = Provider.of<ContactInfoState>(context).isGroup;
var composeBox = Container(
color: Provider.of<Settings>(context).theme.backgroundMainColor,
@ -262,6 +274,8 @@ class _MessageViewState extends State<MessageView> {
keyboardType: TextInputType.multiline,
enableIMEPersonalizedLearning: false,
minLines: 1,
maxLength: isGroup ? GroupMessageLengthMax : P2PMessageLengthMax,
maxLengthEnforcement: MaxLengthEnforcement.enforced,
maxLines: null,
onFieldSubmitted: _sendMessage,
enabled: !isOffline,