Skip to content

Commit 66e4835

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 b825a46 commit 66e4835

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ const NotificationSettingIcon = () => {
4444
/>
4545
);
4646
case 'mentions_only':
47+
default:
4748
return (
4849
<SessionIcon
4950
iconType="bell"
5051
iconColor={'var(--conversation-tab-text-color)'}
5152
iconSize="small"
5253
/>
5354
);
54-
default:
55-
return null;
5655
}
5756
};
5857

ts/hooks/useParamSelector.ts

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

112112
export function useNotificationSetting(convoId?: string) {
113113
const convoProps = useConversationPropsById(convoId);
114-
return convoProps?.currentNotificationSetting || 'all';
114+
return convoProps?.currentNotificationSetting || 'mentions_only';
115115
}
116116
export function useIsPublic(convoId?: string) {
117117
const convoProps = useConversationPropsById(convoId);

ts/models/conversationAttributes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const fillConvoAttributesWithDefaults = (
124124
lastMessageStatus: undefined,
125125
lastMessage: null,
126126

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

129129
isTrustedForAttachmentDownload: false, // we don't trust a contact until we say so
130130
isApproved: false,

ts/node/database_utility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export function formatRowOfConversation(
141141
}
142142

143143
if (!convo.triggerNotificationsFor) {
144-
convo.triggerNotificationsFor = 'all';
144+
convo.triggerNotificationsFor = 'mentions_only';
145145
}
146146

147147
if (!convo.lastJoinedTimestamp) {

ts/node/migration/sessionMigrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ function updateToSessionSchemaVersion24(currentVersion: number, db: BetterSqlite
755755
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN avatarHash TEXT; -- only used for opengroup avatar.
756756
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN nickname TEXT;
757757
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN profileKey TEXT;
758-
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN triggerNotificationsFor TEXT DEFAULT "all";
758+
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN triggerNotificationsFor TEXT DEFAULT "mentions_only";
759759
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN isTrustedForAttachmentDownload INTEGER DEFAULT "FALSE";
760760
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN isPinned INTEGER DEFAULT "FALSE";
761761
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN isApproved INTEGER DEFAULT "FALSE";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('fillConvoAttributesWithDefaults', () => {
149149
it('initialize triggerNotificationsFor if not given', () => {
150150
expect(fillConvoAttributesWithDefaults({} as ConversationAttributes)).to.have.deep.property(
151151
'triggerNotificationsFor',
152-
'all'
152+
'mentions_only'
153153
);
154154
});
155155

0 commit comments

Comments
 (0)