piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 51 forks source link

Notification not sent without body #311

Closed MorsMortium closed 8 months ago

MorsMortium commented 9 months ago

OS: Arch arm KDE Device: Pinetime App version: 2.1.3 If a notification is sent without the optional body, it won't be forwarded to the device, even though harbour-amazfish sees it. I have tested this with notify-send.

notify-send Body BodyText results

2023-11-16 15:02:26.465 : Incoming notification 37 Notification(appId="", appName="notify-send", summary="Body", body="BodyText", appIcon="", hints=QHash(), timeout=-1, actions=())
2023-11-16 15:02:26.465 : Sending alert to device
2023-11-16 15:02:26.465 : PT Have an alert service
2023-11-16 15:02:26.466 : Alert: "notify-send" "Body" "BodyText"
2023-11-16 15:02:26.466 : Writing to  "00002a46-0000-1000-8000-00805f9b34fb" : "fa010b6e6f746966792d73656e640a426f64790a0a426f647954657874"
2023-11-16 15:02:31.598 : Close notification 37 1

While notify-send NoBody results

2023-11-16 15:06:53.887 : Incoming notification 38 Notification(appId="", appName="notify-send", summary="NoBody", body="", appIcon="", hints=QHash(), timeout=-1, actions=())
2023-11-16 15:06:53.887 : Sending alert to device
2023-11-16 15:06:53.887 : PT Have an alert service
2023-11-16 15:06:53.887 : Alert: "notify-send" "NoBody" ""
2023-11-16 15:06:58.941 : Close notification 38 1

The Writing to part is missing.

piggz commented 9 months ago

I guess this comes from https://github.com/piggz/harbour-amazfish/blob/master/daemon/src/services/alertnotificationservice.cpp#L20

Question is, is the message really optional?

MorsMortium commented 9 months ago

https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html

If the body is omitted, just the summary is displayed.

It is, and there are apps using this, like Spacebar, the SMS app.