diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index af82533..5686c4b 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -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 } diff --git a/src/Types/Auth.ts b/src/Types/Auth.ts index 1b78bb0..1010da6 100644 --- a/src/Types/Auth.ts +++ b/src/Types/Auth.ts @@ -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 } export type AuthenticationCreds = SignalCreds & {