|
1 | 1 | import 'dart:async';
|
2 | 2 | import 'dart:io';
|
3 | 3 |
|
4 |
| -import 'package:http/http.dart' as http; |
5 | 4 | import 'package:collection/collection.dart';
|
6 | 5 | import 'package:flutter/foundation.dart';
|
7 | 6 | import 'package:flutter/widgets.dart' hide Notification;
|
| 7 | +import 'package:http/http.dart' as http; |
8 | 8 |
|
9 | 9 | import '../api/model/model.dart';
|
10 | 10 | import '../api/notifications.dart';
|
@@ -231,7 +231,7 @@ class NotificationDisplayManager {
|
231 | 231 | static Future<void> _onMessageFcmMessage(MessageFcmMessage data, Map<String, dynamic> dataJson) async {
|
232 | 232 | assert(debugLog('notif message content: ${data.content}'));
|
233 | 233 | final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
|
234 |
| - final groupKey = _groupKey(data); |
| 234 | + final groupKey = _groupKey(data.realmUrl, data.userId); |
235 | 235 | final conversationKey = _conversationKey(data, groupKey);
|
236 | 236 |
|
237 | 237 | final oldMessagingStyle = await _androidHost
|
@@ -365,7 +365,7 @@ class NotificationDisplayManager {
|
365 | 365 | // There may be a lot of messages mentioned here, across a lot of
|
366 | 366 | // conversations. But they'll all be for one account, so they'll
|
367 | 367 | // fall under one notification group.
|
368 |
| - final groupKey = _groupKey(data); |
| 368 | + final groupKey = _groupKey(data.realmUrl, data.userId); |
369 | 369 |
|
370 | 370 | // Find any conversations we can cancel the notification for.
|
371 | 371 | // The API doesn't lend itself to removing individual messages as
|
@@ -445,10 +445,10 @@ class NotificationDisplayManager {
|
445 | 445 | return '$groupKey|$conversation';
|
446 | 446 | }
|
447 | 447 |
|
448 |
| - static String _groupKey(FcmMessageWithIdentity data) { |
| 448 | + static String _groupKey(Uri realmUrl, int userId) { |
449 | 449 | // The realm URL can't contain a `|`, because `|` is not a URL code point:
|
450 | 450 | // https://url.spec.whatwg.org/#url-code-points
|
451 |
| - return "${data.realmUrl}|${data.userId}"; |
| 451 | + return "$realmUrl|$userId"; |
452 | 452 | }
|
453 | 453 |
|
454 | 454 | static String _personKey(Uri realmUrl, int userId) => "$realmUrl|$userId";
|
|
0 commit comments