Moyoung: Fix malformed notifications when sender/title contains colon

This commit is contained in:
Arjan Schrijver
2025-06-11 20:58:00 +02:00
parent cf78c7e67f
commit 4c32dc9740
@@ -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";
}