diff --git a/src/api/controllers/instance.controller.ts b/src/api/controllers/instance.controller.ts index 3b2ea0e4..2415fd83 100644 --- a/src/api/controllers/instance.controller.ts +++ b/src/api/controllers/instance.controller.ts @@ -401,6 +401,7 @@ export class InstanceController { read_messages: read_messages || false, read_status: read_status || false, sync_full_history: sync_full_history ?? false, + ignore_list: [], }; this.logger.verbose('settings: ' + JSON.stringify(settings)); diff --git a/src/api/dto/settings.dto.ts b/src/api/dto/settings.dto.ts index 8cd67948..f74c625d 100644 --- a/src/api/dto/settings.dto.ts +++ b/src/api/dto/settings.dto.ts @@ -6,4 +6,5 @@ export class SettingsDto { read_messages?: boolean; read_status?: boolean; sync_full_history?: boolean; + ignore_list?: string[]; } diff --git a/src/api/integrations/kwik/controllers/kwik.controller.ts b/src/api/integrations/kwik/controllers/kwik.controller.ts index 9328f3ac..cf5779da 100644 --- a/src/api/integrations/kwik/controllers/kwik.controller.ts +++ b/src/api/integrations/kwik/controllers/kwik.controller.ts @@ -79,7 +79,7 @@ export class KwikController { ); const mm = msgs.map((msg) => { - const [messageType, lastMsg] = Object.entries(msg.message)[0] || ['none', '']; + const [messageType] = Object.entries(msg.message)[0] || ['none', '']; const chat_data = { id: msg._id, diff --git a/src/api/models/settings.model.ts b/src/api/models/settings.model.ts index 64c032ed..5e0b7e01 100644 --- a/src/api/models/settings.model.ts +++ b/src/api/models/settings.model.ts @@ -11,6 +11,7 @@ export class SettingsRaw { read_messages?: boolean; read_status?: boolean; sync_full_history?: boolean; + ignore_list?: string[]; } const settingsSchema = new Schema({ @@ -22,6 +23,7 @@ const settingsSchema = new Schema({ read_messages: { type: Boolean, required: true }, read_status: { type: Boolean, required: true }, sync_full_history: { type: Boolean, required: true }, + ignore_list: { type: [String], required: false }, }); export const SettingsModel = dbserver?.model(SettingsRaw.name, settingsSchema, 'settings'); diff --git a/src/api/services/channel.service.ts b/src/api/services/channel.service.ts index 966c8897..f48970e5 100644 --- a/src/api/services/channel.service.ts +++ b/src/api/services/channel.service.ts @@ -222,6 +222,7 @@ export class ChannelStartupService { read_messages: data.read_messages, read_status: data.read_status, sync_full_history: data.sync_full_history, + ignore_list: data.ignore_list, }; } diff --git a/src/api/types/wa.types.ts b/src/api/types/wa.types.ts index 94461964..eb9fe99a 100644 --- a/src/api/types/wa.types.ts +++ b/src/api/types/wa.types.ts @@ -83,6 +83,7 @@ export declare namespace wa { read_messages?: boolean; read_status?: boolean; sync_full_history?: boolean; + ignore_list?: string[]; }; export type LocalWebsocket = { diff --git a/src/validate/validate.schema.ts b/src/validate/validate.schema.ts index 8f7cb1a0..532ae2f9 100644 --- a/src/validate/validate.schema.ts +++ b/src/validate/validate.schema.ts @@ -1002,6 +1002,7 @@ export const settingsSchema: JSONSchema7 = { read_messages: { type: 'boolean', enum: [true, false] }, read_status: { type: 'boolean', enum: [true, false] }, sync_full_history: { type: 'boolean', enum: [true, false] }, + ignore_list: { type: 'array', items: { type: 'string' } }, }, required: ['reject_call', 'groups_ignore', 'always_online', 'read_messages', 'read_status', 'sync_full_history'], ...isNotEmpty('reject_call', 'groups_ignore', 'always_online', 'read_messages', 'read_status', 'sync_full_history'),