forked from cwtch.im/cwtch-ui
Merge branch 'trunk' into winFocus
This commit is contained in:
commit
35ae5773f7
|
@ -1 +1 @@
|
|||
2022-01-20-17-22-v1.5.4-16-ge0e1a4b
|
||||
2022-01-26-15-10-v1.5.4-18-gd77d7bb
|
|
@ -1 +1 @@
|
|||
2022-01-20-22-22-v1.5.4-16-ge0e1a4b
|
||||
2022-01-26-20-10-v1.5.4-18-gd77d7bb
|
|
@ -89,8 +89,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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue