File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -468,8 +468,9 @@ class NotificationDisplayManager {
468
468
assert (url.scheme == 'zulip' && url.host == 'notification' );
469
469
final payload = NotificationOpenPayload .parseUrl (url);
470
470
471
- final account = globalStore.accounts.firstWhereOrNull ((account) =>
472
- account.realmUrl == payload.realmUrl && account.userId == payload.userId);
471
+ final account = globalStore.accounts.firstWhereOrNull (
472
+ (account) => account.realmUrl.origin == payload.realmUrl.origin
473
+ && account.userId == payload.userId);
473
474
if (account == null ) return null ;
474
475
475
476
final route = MessageListPage .buildRoute (
Original file line number Diff line number Diff line change @@ -1036,6 +1036,21 @@ void main() {
1036
1036
eg.dmMessage (from: eg.otherUser, to: [eg.selfUser]));
1037
1037
});
1038
1038
1039
+ testWidgets ('account queried by realmUrl origin component' , (tester) async {
1040
+ addTearDown (testBinding.reset);
1041
+ await testBinding.globalStore.add (
1042
+ eg.selfAccount.copyWith (realmUrl: Uri .parse ('http://chat.example' )),
1043
+ eg.initialSnapshot ());
1044
+ await prepare (tester);
1045
+
1046
+ await checkOpenNotification (tester,
1047
+ eg.selfAccount.copyWith (realmUrl: Uri .parse ('http://chat.example/' )),
1048
+ eg.streamMessage ());
1049
+ await checkOpenNotification (tester,
1050
+ eg.selfAccount.copyWith (realmUrl: Uri .parse ('http://chat.example' )),
1051
+ eg.streamMessage ());
1052
+ });
1053
+
1039
1054
testWidgets ('no accounts' , (tester) async {
1040
1055
await prepare (tester, withAccount: false );
1041
1056
await openNotification (tester, eg.selfAccount, eg.streamMessage ());
You can’t perform that action at this time.
0 commit comments