-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TW-504: config notifications for default push rules #568
base: main
Are you sure you want to change the base?
Conversation
'.m.rule.member_event', | ||
(c) => L10n.of(c)!.memberChanges, | ||
'm.rule.change_group_name', | ||
(c) => "Group chat name change", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l10n
'.m.rule.suppress_notices', | ||
(c) => L10n.of(c)!.botMessages, | ||
'm.rule.change_avatar_group', | ||
(c) => "Group chat avatar change", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l10n
lib/widgets/matrix.dart
Outdated
@@ -448,6 +449,77 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver { | |||
createVoipPlugin(); | |||
} | |||
|
|||
Future<void> _setUpUserDefinedPushRules(Client client) async { | |||
await client.setPushRuleEnabled( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Future.wait
for some parallel rules
lib/widgets/matrix.dart
Outdated
final homeServerUrlInterceptor = getIt.get<DynamicUrlInterceptors>( | ||
instanceName: NetworkDI.homeServerUrlInterceptorName, | ||
); | ||
Logs().d( | ||
'MatrixState::_setUpHomeServer: ${homeServerUrlInterceptor.baseUrl}', | ||
); | ||
homeServerUrlInterceptor.changeBaseUrl(homeServerUri.toString()); | ||
_setUpUserDefinedPushRules(client); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to call it one time in login?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make sure this will not make conflict with other setup in other device?
IMO, it is good. Can you write ADRs to describe about:
|
} | ||
|
||
bool containsRule(String ruleId) { | ||
final rule = devicePushRules?.override?.firstWhere((PushRule rule) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final rule = devicePushRules?.override?.firstWhere((PushRule rule) { | |
final rule = devicePushRules?.override?.any((rule) => rule.ruleId == ruleId); |
@@ -522,7 +613,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver { | |||
} | |||
} | |||
|
|||
void _setUpHomeServer(Uri homeServerUri) { | |||
void _setUpHomeServer(Uri homeServerUri) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please show demo for new settings
} | ||
} | ||
|
||
bool containsRule(String ruleId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where you can put this check? Before or after sync?
], | ||
), | ||
client.setupUserDefinedPushRule( | ||
ruleId: 'm.rule.set_me_as_admin', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruleId: 'm.rule.set_me_as_admin', | |
ruleId: 'm.rule.change_power_level', |
Demo:
RPReplay_Final1694021601.MP4