feat: handle default disappearing mode change notifications

This commit is contained in:
Adhiraj Singh
2022-10-12 19:11:14 +05:30
parent 9eea8e4f82
commit 6663357a37
2 changed files with 18 additions and 0 deletions

View File

@@ -314,6 +314,22 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
}
break
case 'account_sync':
if(child.tag === 'disappearing_mode') {
const newDuration = +child.attrs.duration
const timestamp = +child.attrs.t
ev.emit('creds.update', {
accountSettings: {
...authState.creds.accountSettings,
defaultDisappearingMode: {
ephemeralExpiration: newDuration,
ephemeralSettingTimestamp: timestamp,
},
}
})
}
break
}

View File

@@ -31,6 +31,8 @@ export type SignalCreds = {
export type AccountSettings = {
/** unarchive chats when a new message is received */
unarchiveChats: boolean
/** the default mode to start new conversations with */
defaultDisappearingMode?: Pick<proto.IConversation, 'ephemeralExpiration' | 'ephemeralSettingTimestamp'>
}
export type AuthenticationCreds = SignalCreds & {