chore: Support new unifiedpush gateway discovery

This commit is contained in:
Sorunome 2021-08-01 09:55:57 +02:00
parent 5962f386f6
commit 9e96135ad6
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C

View File

@ -346,7 +346,9 @@ class BackgroundPush {
.first; .first;
final res = final res =
json.decode(utf8.decode((await http.get(Uri.parse(url))).bodyBytes)); json.decode(utf8.decode((await http.get(Uri.parse(url))).bodyBytes));
if (res['gateway'] == 'matrix') { if (res['gateway'] == 'matrix' ||
(res['unifiedpush'] is Map &&
res['unifiedpush']['gateway'] == 'matrix')) {
endpoint = url; endpoint = url;
} }
} catch (e) { } catch (e) {