Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

Commit b289ce1

Browse files
committed
Make default notification setting for conversations 'mentions only'.
The current default of 'all' is very noisy, especially when restoring an account or linking a new device, which causes all instantiated conversations to start sending notifications.
1 parent 0794ede commit b289ce1

File tree

7 files changed

+8
-10
lines changed

7 files changed

+8
-10
lines changed

ts/components/leftpane/conversation-list-item/HeaderItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,14 @@ const NotificationSettingIcon = (props: { isMessagesSection: boolean }) => {
3838
/>
3939
);
4040
case 'mentions_only':
41+
default:
4142
return (
4243
<SessionIcon
4344
iconType="bell"
4445
iconColor={'var(--conversation-tab-text-color)'}
4546
iconSize="small"
4647
/>
4748
);
48-
default:
49-
return null;
5049
}
5150
};
5251

ts/hooks/useParamSelector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function useHasNickname(convoId?: string) {
9393

9494
export function useNotificationSetting(convoId?: string) {
9595
const convoProps = useConversationPropsById(convoId);
96-
return convoProps?.currentNotificationSetting || 'all';
96+
return convoProps?.currentNotificationSetting || 'mentions_only';
9797
}
9898
export function useIsPublic(convoId?: string) {
9999
const convoProps = useConversationPropsById(convoId);

ts/models/conversationAttributes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const fillConvoAttributesWithDefaults = (
9090
lastMessageStatus: undefined,
9191
lastMessage: null,
9292

93-
triggerNotificationsFor: 'all', // if the settings is not set in the db, this is the default
93+
triggerNotificationsFor: 'mentions_only', // if the settings is not set in the db, this is the default
9494

9595
isTrustedForAttachmentDownload: false, // we don't trust a contact until we say so
9696
isPinned: false,

ts/node/database_utility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function formatRowOfConversation(row?: Record<string, any>): Conversation
145145
}
146146

147147
if (!convo.triggerNotificationsFor) {
148-
convo.triggerNotificationsFor = 'all';
148+
convo.triggerNotificationsFor = 'mentions_only';
149149
}
150150

151151
if (!convo.unreadCount) {

ts/node/migration/sessionMigrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ function updateToSessionSchemaVersion24(currentVersion: number, db: BetterSqlite
729729
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN avatarHash TEXT; -- only used for opengroup avatar.
730730
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN nickname TEXT;
731731
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN profileKey TEXT;
732-
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN triggerNotificationsFor TEXT DEFAULT "all";
732+
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN triggerNotificationsFor TEXT DEFAULT "mentions_only";
733733
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN isTrustedForAttachmentDownload INTEGER DEFAULT "FALSE";
734734
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN isPinned INTEGER DEFAULT "FALSE";
735735
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN isApproved INTEGER DEFAULT "FALSE";

ts/state/selectors/conversations.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,11 @@ export const getCurrentNotificationSettingText = createSelector(getSelectedConve
577577
switch (state.currentNotificationSetting) {
578578
case 'all':
579579
return window.i18n('notificationForConvo_all');
580-
case 'mentions_only':
581-
return window.i18n('notificationForConvo_mentions_only');
582580
case 'disabled':
583581
return window.i18n('notificationForConvo_disabled');
582+
case 'mentions_only':
584583
default:
585-
return window.i18n('notificationForConvo_all');
584+
return window.i18n('notificationForConvo_mentions_only');
586585
}
587586
});
588587

ts/test/session/unit/models/ConversationModels_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('fillConvoAttributesWithDefaults', () => {
163163
it('initialize triggerNotificationsFor if not given', () => {
164164
expect(fillConvoAttributesWithDefaults({} as ConversationAttributes)).to.have.deep.property(
165165
'triggerNotificationsFor',
166-
'all'
166+
'mentions_only'
167167
);
168168
});
169169

0 commit comments

Comments
 (0)