feat(appstate): emit setting events (#2057)
This commit is contained in:
@@ -904,6 +904,47 @@ export const processSyncAction = (
|
||||
labelId: syncAction.index[1]
|
||||
} as MessageLabelAssociation)
|
||||
})
|
||||
} else if (action?.localeSetting?.locale) {
|
||||
ev.emit('settings.update', { setting: 'locale', value: action.localeSetting.locale })
|
||||
} else if (action?.timeFormatAction) {
|
||||
ev.emit('settings.update', { setting: 'timeFormat', value: action.timeFormatAction })
|
||||
} else if (action?.pnForLidChatAction) {
|
||||
if (action.pnForLidChatAction.pnJid) {
|
||||
ev.emit('lid-mapping.update', { lid: id!, pn: action.pnForLidChatAction.pnJid })
|
||||
}
|
||||
} else if (action?.privacySettingRelayAllCalls) {
|
||||
ev.emit('settings.update', {
|
||||
setting: 'privacySettingRelayAllCalls',
|
||||
value: action.privacySettingRelayAllCalls
|
||||
})
|
||||
} else if (action?.statusPrivacy) {
|
||||
ev.emit('settings.update', { setting: 'statusPrivacy', value: action.statusPrivacy })
|
||||
} else if (action?.lockChatAction) {
|
||||
ev.emit('chats.lock', { id: id!, locked: !!action.lockChatAction.locked })
|
||||
} else if (action?.privacySettingDisableLinkPreviewsAction) {
|
||||
ev.emit('settings.update', {
|
||||
setting: 'disableLinkPreviews',
|
||||
value: action.privacySettingDisableLinkPreviewsAction
|
||||
})
|
||||
} else if (action?.notificationActivitySettingAction?.notificationActivitySetting) {
|
||||
ev.emit('settings.update', {
|
||||
setting: 'notificationActivitySetting',
|
||||
value: action.notificationActivitySettingAction.notificationActivitySetting
|
||||
})
|
||||
} else if (action?.lidContactAction) {
|
||||
ev.emit('contacts.upsert', [
|
||||
{
|
||||
id: id!,
|
||||
name: action.lidContactAction.fullName!,
|
||||
lid: id!,
|
||||
phoneNumber: undefined
|
||||
}
|
||||
])
|
||||
} else if (action?.privacySettingChannelsPersonalisedRecommendationAction) {
|
||||
ev.emit('settings.update', {
|
||||
setting: 'channelsPersonalisedRecommendation',
|
||||
value: action.privacySettingChannelsPersonalisedRecommendationAction
|
||||
})
|
||||
} else {
|
||||
logger?.debug({ syncAction, id }, 'unprocessable update')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user