mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 23:30:28 +03:00
Remove large comment block, no longer needed
This commit is contained in:
parent
13d38e8525
commit
c57509ac7b
1 changed files with 0 additions and 31 deletions
|
|
@ -86,7 +86,6 @@ export async function enablePushNotifications(
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
navigator.serviceWorker.controller?.postMessage({
|
navigator.serviceWorker.controller?.postMessage({
|
||||||
url: mx.baseUrl,
|
url: mx.baseUrl,
|
||||||
type: 'togglePush',
|
type: 'togglePush',
|
||||||
|
|
@ -168,40 +167,10 @@ export async function deRegisterAllPushers(mx: MatrixClient): Promise<void> {
|
||||||
|
|
||||||
export async function togglePusher(
|
export async function togglePusher(
|
||||||
mx: MatrixClient,
|
mx: MatrixClient,
|
||||||
subscription: PushSubscription,
|
|
||||||
clientConfig: ClientConfig,
|
clientConfig: ClientConfig,
|
||||||
visible: boolean
|
visible: boolean
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const MUTE_RULE_ID = 'cc.cinny.mute_push';
|
|
||||||
const p256dhKey = subscription?.toJSON().keys?.p256dh;
|
|
||||||
const { pushers } = await mx.getPushers();
|
|
||||||
const existingPusher = pushers.find((p) => p.pushkey === p256dhKey);
|
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
/*
|
|
||||||
Need to clean up the old push rules I made
|
|
||||||
The push rules should be removed upon roomId change
|
|
||||||
and a new one added for the NEW current room
|
|
||||||
|
|
||||||
On visibility change push rule should be added for the given room
|
|
||||||
so in background pushrule removed and in foreground pushrule added
|
|
||||||
|
|
||||||
In some ways it is simply easier to just de-register the push notificaitons
|
|
||||||
as this gives perfect behavior. Then on visibility change re-enable them.
|
|
||||||
We can check the stored setting for background push notifs and if it exists
|
|
||||||
enable the push notifs based on that settings value.
|
|
||||||
Can look to the SettingsNotifications for how the other settings are stored.
|
|
||||||
|
|
||||||
I might also want to mention that the reason I list the above
|
|
||||||
is explicitly BECAUSE otherwise we use both push notifs and the normal notifs
|
|
||||||
|
|
||||||
Tuwunnel fails to deserialize custom tweaks as a result of:
|
|
||||||
https://github.com/ruma/ruma/issues/368 <- related deserialization issue
|
|
||||||
https://github.com/serde-rs/serde/issues/1183 <- upstream for ruma for deserializing
|
|
||||||
|
|
||||||
Instead we'll do a hackier bypass, but only Cinny will acknowledge this as the client is responsible
|
|
||||||
for handling the sounds themselves. This is more or less a custom tweak still.
|
|
||||||
*/
|
|
||||||
disablePushNotifications(mx, clientConfig);
|
disablePushNotifications(mx, clientConfig);
|
||||||
} else {
|
} else {
|
||||||
enablePushNotifications(mx, clientConfig);
|
enablePushNotifications(mx, clientConfig);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue