mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-26 10:28:38 -06:00
Adds ignore_list to instance settings
This commit is contained in:
parent
58ef0cb3ac
commit
5055f6a1ff
@ -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));
|
||||
|
@ -6,4 +6,5 @@ export class SettingsDto {
|
||||
read_messages?: boolean;
|
||||
read_status?: boolean;
|
||||
sync_full_history?: boolean;
|
||||
ignore_list?: string[];
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -11,6 +11,7 @@ export class SettingsRaw {
|
||||
read_messages?: boolean;
|
||||
read_status?: boolean;
|
||||
sync_full_history?: boolean;
|
||||
ignore_list?: string[];
|
||||
}
|
||||
|
||||
const settingsSchema = new Schema<SettingsRaw>({
|
||||
@ -22,6 +23,7 @@ const settingsSchema = new Schema<SettingsRaw>({
|
||||
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');
|
||||
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,7 @@ export declare namespace wa {
|
||||
read_messages?: boolean;
|
||||
read_status?: boolean;
|
||||
sync_full_history?: boolean;
|
||||
ignore_list?: string[];
|
||||
};
|
||||
|
||||
export type LocalWebsocket = {
|
||||
|
@ -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'),
|
||||
|
Loading…
Reference in New Issue
Block a user