Skip to content

Commit

Permalink
[Calendar] Adds differentiation between push identifiers
Browse files Browse the repository at this point in the history
This commit adds the App field to push identifiers, letting the
server know if the identifier belongs to Mail or Calendar app and
send notifications correctly according to the app.

Closes #7149
  • Loading branch information
mup committed Jul 8, 2024
1 parent b1fbfe9 commit 3e33aab
Show file tree
Hide file tree
Showing 21 changed files with 6,901 additions and 445 deletions.
10 changes: 10 additions & 0 deletions schemas/sys.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@
"info": "AddAssociation GroupKeyRotationData/groupKeyUpdatesForMembers/AGGREGATION/2397."
}
]
},
{
"version": 103,
"changes": [
{
"name": "AddValue",
"sourceType": "PushIdentifier",
"info": "AddValue PushIdentifier/app/2411."
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { NotFoundError } from "../../../common/api/common/error/RestError.js"
import { PushServiceType } from "../../../common/api/common/TutanotaConstants.js"
import { SettingsNotificationTargets, SettingsNotificationTargetsAttrs } from "../../../common/settings/SettingsNotificationTargets.js"
import { EntityUpdateData, isUpdateForTypeRef } from "../../../common/api/common/utils/EntityUpdateUtils.js"
import { PushIdentifierAppType } from "../../../common/native/main/NativePushServiceApp.js"

export class NotificationSettingsViewer implements UpdatableSettingsViewer {
private currentIdentifier: string | null = null
Expand Down Expand Up @@ -73,7 +74,9 @@ export class NotificationSettingsViewer implements UpdatableSettingsViewer {
const list = this.user.pushIdentifierList

if (list) {
this.identifiers = await locator.entityClient.loadAll(PushIdentifierTypeRef, list.list)
this.identifiers = (await locator.entityClient.loadAll(PushIdentifierTypeRef, list.list)).filter(
(identifier) => identifier.app === PushIdentifierAppType.Calendar,
) // Filter out mail targets

m.redraw()
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/api/entities/sys/ModelInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const modelInfo = {
version: 102,
compatibleSince: 102,
version: 103,
compatibleSince: 103,
}

export default modelInfo
Loading

0 comments on commit 3e33aab

Please sign in to comment.