mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-26 20:06:52 +01:00
Moyoung: Fix malformed notifications when sender/title contains colon
This commit is contained in:
parent
0f9c278a2e
commit
e95892f30b
@ -523,7 +523,9 @@ public class MoyoungDeviceSupport extends AbstractBTLEDeviceSupport {
|
||||
public void onNotification(NotificationSpec notificationSpec) {
|
||||
final String senderOrTitle = StringUtils.getFirstOf(notificationSpec.sender, notificationSpec.title);
|
||||
|
||||
String message = StringUtils.truncate(senderOrTitle, 32) + ":";
|
||||
// Notifications are sent with both sender/title and message in 1 packet, separated by a ':',
|
||||
// so we have to make sure there is no ':' in the sender/title part
|
||||
String message = StringUtils.truncate(senderOrTitle, 32).replace(":", ";") + ":";
|
||||
if (notificationSpec.subject != null) {
|
||||
message += StringUtils.truncate(notificationSpec.subject, 128) + "\n\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user