@@ -197,7 +197,7 @@ class BackgroundPush {
197
197
)) {
198
198
Logs ().i ('[Push] Pusher already set' );
199
199
} else {
200
- Logs ().i ('Need to set new pusher' );
200
+ Logs ().i ('[Push] Need to set new pusher' );
201
201
oldTokens.add (token);
202
202
if (client.isLogged ()) {
203
203
setNewPusher = true ;
@@ -253,6 +253,27 @@ class BackgroundPush {
253
253
254
254
Future <void > setupPush (List <Client > clients) async {
255
255
Logs ().d ("SetupPush" );
256
+
257
+ {
258
+ // migrate single client push settings to multiclient settings
259
+ final endpoint = matrix! .store.getString (SettingKeys .unifiedPushEndpoint);
260
+ if (endpoint != null ) {
261
+ matrix! .store.setString (
262
+ clients.first.clientName + SettingKeys .unifiedPushEndpoint,
263
+ endpoint);
264
+ matrix! .store.remove (SettingKeys .unifiedPushEndpoint);
265
+ }
266
+
267
+ final registered =
268
+ matrix! .store.getBool (SettingKeys .unifiedPushRegistered);
269
+ if (registered != null ) {
270
+ matrix! .store.setBool (
271
+ clients.first.clientName + SettingKeys .unifiedPushRegistered,
272
+ registered);
273
+ matrix! .store.remove (SettingKeys .unifiedPushRegistered);
274
+ }
275
+ }
276
+
256
277
if (clients.first.onLoginStateChanged.value != LoginState .loggedIn ||
257
278
! PlatformInfos .isMobile ||
258
279
matrix == null ) {
@@ -420,7 +441,9 @@ class BackgroundPush {
420
441
client: client,
421
442
);
422
443
await matrix? .store.setString (
423
- client.clientName + SettingKeys .unifiedPushEndpoint, newEndpoint);
444
+ client.clientName + SettingKeys .unifiedPushEndpoint,
445
+ newEndpoint,
446
+ );
424
447
await matrix? .store
425
448
.setBool (client.clientName + SettingKeys .unifiedPushRegistered, true );
426
449
}
0 commit comments