|
|
@ -58,14 +58,8 @@ class SettingsNotifications extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class SettingsNotificationsController extends State<SettingsNotifications> {
|
|
|
|
class SettingsNotificationsController extends State<SettingsNotifications> {
|
|
|
|
bool? getNotificationSetting(NotificationSettingsItem item) {
|
|
|
|
bool? getNotificationSetting(NotificationSettingsItem item) {
|
|
|
|
// Until https://gitlab.com/famedly/company/frontend/famedlysdk/-/merge_requests/1124 is shipped
|
|
|
|
final pushRules = Matrix.of(context).client.globalPushRules;
|
|
|
|
final pushRulesRaw = Matrix.of(context)
|
|
|
|
if (pushRules == null) return null;
|
|
|
|
.client
|
|
|
|
|
|
|
|
.accountData['m.push_rules']
|
|
|
|
|
|
|
|
?.content
|
|
|
|
|
|
|
|
.tryGetMap<String, dynamic>('device');
|
|
|
|
|
|
|
|
if (pushRulesRaw == null) return null;
|
|
|
|
|
|
|
|
final pushRules = PushRuleSet.fromJson(pushRulesRaw);
|
|
|
|
|
|
|
|
switch (item.type) {
|
|
|
|
switch (item.type) {
|
|
|
|
case PushRuleKind.content:
|
|
|
|
case PushRuleKind.content:
|
|
|
|
return pushRules.content
|
|
|
|
return pushRules.content
|
|
|
|