Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add validating contentChanged logic
  • Loading branch information
woals4815 committed Jun 15, 2025
commit f5896671dd6fb2d7f78b090445c83c801d97317f
10 changes: 10 additions & 0 deletions src/messaging/messaging-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ function validateAps(aps: Aps): void {
contentAvailable: 'content-available',
mutableContent: 'mutable-content',
threadId: 'thread-id',
contentChanged: 'content-changed',
};
Object.keys(propertyMappings).forEach((key) => {
if (key in aps && propertyMappings[key] in aps) {
Expand All @@ -300,6 +301,15 @@ function validateAps(aps: Aps): void {
delete aps['mutable-content'];
}
}

const contentChanged = aps['content-changed'];
if (typeof contentChanged !== 'undefined' && contentChanged !== 1) {
if (contentChanged === true) {
aps['content-changed'] = 1;
} else {
delete aps['content-changed'];
}
}
}

function validateApsSound(sound: string | CriticalSound | undefined): void {
Expand Down