mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-28 06:26:39 +10:00
removed truncation of notification as in Issue #107
This commit is contained in:
@@ -112,7 +112,7 @@ class NotificationService {
|
|||||||
await _notifications.show(
|
await _notifications.show(
|
||||||
contactId?.hashCode ?? 0,
|
contactId?.hashCode ?? 0,
|
||||||
'New message from $contactName',
|
'New message from $contactName',
|
||||||
message.length > 100 ? '${message.substring(0, 100)}...' : message,
|
message,
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: 'message:$contactId',
|
payload: 'message:$contactId',
|
||||||
);
|
);
|
||||||
@@ -203,7 +203,7 @@ class NotificationService {
|
|||||||
macOS: macDetails,
|
macOS: macDetails,
|
||||||
);
|
);
|
||||||
|
|
||||||
final preview = _truncateMessage(message, 30);
|
final preview = message.trim();
|
||||||
final body = preview.isEmpty
|
final body = preview.isEmpty
|
||||||
? 'Received new message'
|
? 'Received new message'
|
||||||
: preview;
|
: preview;
|
||||||
@@ -217,12 +217,6 @@ class NotificationService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String _truncateMessage(String message, int maxLength) {
|
|
||||||
final trimmed = message.trim();
|
|
||||||
if (trimmed.length <= maxLength) return trimmed;
|
|
||||||
return '${trimmed.substring(0, maxLength)}...';
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onNotificationTapped(NotificationResponse response) {
|
void _onNotificationTapped(NotificationResponse response) {
|
||||||
final payload = response.payload;
|
final payload = response.payload;
|
||||||
if (payload != null) {
|
if (payload != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user