mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: handle default disappearing mode change notifications
This commit is contained in:
@@ -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
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ export type SignalCreds = {
|
|||||||
export type AccountSettings = {
|
export type AccountSettings = {
|
||||||
/** unarchive chats when a new message is received */
|
/** unarchive chats when a new message is received */
|
||||||
unarchiveChats: boolean
|
unarchiveChats: boolean
|
||||||
|
/** the default mode to start new conversations with */
|
||||||
|
defaultDisappearingMode?: Pick<proto.IConversation, 'ephemeralExpiration' | 'ephemeralSettingTimestamp'>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AuthenticationCreds = SignalCreds & {
|
export type AuthenticationCreds = SignalCreds & {
|
||||||
|
|||||||
Reference in New Issue
Block a user