mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-03-13 01:30:09 +01:00
AsteroidOS: fix missing sender notification attribute
AsteroidOS generally uses the 'summary' field for the notification's sender - this commit should make gadgetbridge behave more consistently with AsteroidOSSync This fix was suggested by Jose Rebelo
This commit is contained in:
parent
a68d3215a8
commit
60c91af5bb
@ -26,6 +26,8 @@ import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* An adapter for notifications on AsteroidOS
|
||||
*/
|
||||
@ -62,7 +64,7 @@ public class AsteroidOSNotification {
|
||||
public AsteroidOSNotification(NotificationSpec spec) {
|
||||
this.body = spec.body;
|
||||
this.applicationName = spec.sourceName;
|
||||
this.summary = spec.subject;
|
||||
this.summary = StringUtils.firstNonBlank(spec.sender, spec.title, spec.subject);
|
||||
this.id = spec.getId();
|
||||
this.packageName = spec.sourceAppId;
|
||||
this.icon = this.gbNotificationTypeToIcon(spec.type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user