Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32119656
D14340.1765020498.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14340.1765020498.diff
View Options
diff --git a/lib/shared/messages/multimedia-message-spec.js b/lib/shared/messages/multimedia-message-spec.js
--- a/lib/shared/messages/multimedia-message-spec.js
+++ b/lib/shared/messages/multimedia-message-spec.js
@@ -5,8 +5,8 @@
import {
type MessageSpec,
type MessageTitleParam,
- messageNotifyTypes,
type RawMessageInfoFromServerDBRowParams,
+ messageNotifyTypes,
} from './message-spec.js';
import { joinResult } from './utils.js';
import {
@@ -309,7 +309,17 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
threadInfo: ThreadInfo,
- ): Promise<NotifTexts> {
+ ): Promise<?NotifTexts> {
+ // We don't send any notifs in the sidebarCreation case
+ // in order to avoid a double-notif
+ if (
+ messageInfos.length === 3 &&
+ messageInfos[2].type === messageTypes.SIDEBAR_SOURCE &&
+ messageInfos[1].type === messageTypes.CREATE_SIDEBAR
+ ) {
+ return null;
+ }
+
const media = [];
for (const messageInfo of messageInfos) {
invariant(
@@ -345,7 +355,11 @@
notificationCollapseKey(
rawMessageInfo: RawMediaMessageInfo | RawImagesMessageInfo,
+ messageData: MediaMessageData | ImagesMessageData,
): string {
+ if (messageData.sidebarCreation) {
+ return joinResult(messageTypes.CREATE_SIDEBAR, rawMessageInfo.threadID);
+ }
// We use the legacy constant here to collapse both types into one
return joinResult(
messageTypes.IMAGES,
@@ -354,13 +368,7 @@
);
},
- getMessageNotifyType: async (
- rawMessageInfo: RawMediaMessageInfo | RawImagesMessageInfo,
- messageData: MediaMessageData | ImagesMessageData,
- ) =>
- messageData.sidebarCreation
- ? messageNotifyTypes.SET_UNREAD
- : messageNotifyTypes.NOTIF_AND_SET_UNREAD,
+ getMessageNotifyType: async () => messageNotifyTypes.NOTIF_AND_SET_UNREAD,
includedInRepliesCount: true,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 11:28 AM (13 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5836848
Default Alt Text
D14340.1765020498.diff (1 KB)
Attached To
Mode
D14340: [lib] Use notificationCollapseKey to dedup sidebarCreation notifs in multimediaMessageSpec
Attached
Detach File
Event Timeline
Log In to Comment