Skip to content

Commit c2b392b

Browse files
committedJan 5, 2025
Ignore silent notifications
1 parent bb48b5f commit c2b392b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/components/ble/AppleNotificationCenterClient.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void AppleNotificationCenterClient::OnNotification(ble_gap_event* event) {
206206
os_mbuf_copydata(event->notify_rx.om, 3, 1, &categoryCount);
207207
os_mbuf_copydata(event->notify_rx.om, 4, 4, &notificationUuid);
208208

209-
// bool silent = eventFlags & static_cast<uint8_t>(EventFlags::Silent);
209+
bool silent = (eventFlags & static_cast<uint8_t>(EventFlags::Silent)) != 0;
210210
// bool important = eventFlags & static_cast<uint8_t>(EventFlags::Important);
211211
bool preExisting = (eventFlags & static_cast<uint8_t>(EventFlags::PreExisting)) != 0;
212212
// bool positiveAction = eventFlags & static_cast<uint8_t>(EventFlags::PositiveAction);
@@ -224,11 +224,11 @@ void AppleNotificationCenterClient::OnNotification(ble_gap_event* event) {
224224

225225
if (notifications.contains(notificationUuid)) {
226226
notifications[notificationUuid] = ancsNotif;
227-
} else {
227+
} else if (!silent) {
228228
notifications.insert({notificationUuid, ancsNotif});
229229
}
230230

231-
if (preExisting || eventId != static_cast<uint8_t>(EventIds::Added)) {
231+
if (preExisting || eventId != static_cast<uint8_t>(EventIds::Added) || silent) {
232232
return;
233233
}
234234

0 commit comments

Comments
 (0)