mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-18 19:32:21 -06:00
feat: Organization configuration and logo in chatwoot bot contact
This commit is contained in:
@@ -86,6 +86,8 @@ export class InstanceController {
|
||||
chatwootMergeBrazilContacts,
|
||||
chatwootImportMessages,
|
||||
chatwootDaysLimitImportMessages,
|
||||
chatwootOrganization,
|
||||
chatwootLogo,
|
||||
}: InstanceDto) {
|
||||
try {
|
||||
await this.authService.checkDuplicateToken(token);
|
||||
@@ -383,6 +385,8 @@ export class InstanceController {
|
||||
mergeBrazilContacts: chatwootMergeBrazilContacts ?? false,
|
||||
importMessages: chatwootImportMessages ?? true,
|
||||
daysLimitImportMessages: chatwootDaysLimitImportMessages ?? 60,
|
||||
organization: chatwootOrganization,
|
||||
logo: chatwootLogo,
|
||||
autoCreate: true,
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -29,6 +29,8 @@ export class InstanceDto {
|
||||
chatwootImportMessages?: boolean;
|
||||
chatwootDaysLimitImportMessages?: number;
|
||||
chatwootNameInbox?: string;
|
||||
chatwootOrganization?: string;
|
||||
chatwootLogo?: string;
|
||||
websocketEnabled?: boolean;
|
||||
websocketEvents?: string[];
|
||||
rabbitmqEnabled?: boolean;
|
||||
|
||||
@@ -39,22 +39,6 @@ export class ChatwootController {
|
||||
if (data.signMsg === false) data.signDelimiter = null;
|
||||
}
|
||||
|
||||
if (!data.enabled) {
|
||||
data.accountId = '';
|
||||
data.token = '';
|
||||
data.url = '';
|
||||
data.signMsg = false;
|
||||
data.signDelimiter = null;
|
||||
data.reopenConversation = false;
|
||||
data.conversationPending = false;
|
||||
data.importContacts = false;
|
||||
data.importMessages = false;
|
||||
data.mergeBrazilContacts = false;
|
||||
data.daysLimitImportMessages = 0;
|
||||
data.autoCreate = false;
|
||||
data.nameInbox = '';
|
||||
}
|
||||
|
||||
if (!data.nameInbox || data.nameInbox === '') {
|
||||
data.nameInbox = instance.instanceName;
|
||||
}
|
||||
|
||||
@@ -14,4 +14,6 @@ export class ChatwootDto {
|
||||
importMessages?: boolean;
|
||||
daysLimitImportMessages?: number;
|
||||
autoCreate?: boolean;
|
||||
organization?: string;
|
||||
logo?: string;
|
||||
}
|
||||
|
||||
@@ -115,6 +115,8 @@ export class ChatwootService {
|
||||
`${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`,
|
||||
true,
|
||||
data.number,
|
||||
data.organization,
|
||||
data.logo,
|
||||
);
|
||||
}
|
||||
return data;
|
||||
@@ -161,6 +163,8 @@ export class ChatwootService {
|
||||
webhookUrl: string,
|
||||
qrcode: boolean,
|
||||
number: string,
|
||||
organization?: string,
|
||||
logo?: string,
|
||||
) {
|
||||
const client = await this.clientCw(instance);
|
||||
|
||||
@@ -218,8 +222,8 @@ export class ChatwootService {
|
||||
'123456',
|
||||
inboxId,
|
||||
false,
|
||||
'EvolutionAPI',
|
||||
'https://evolution-api.com/files/evolution-api-favicon.png',
|
||||
organization ? organization : 'EvolutionAPI',
|
||||
logo ? logo : 'https://evolution-api.com/files/evolution-api-favicon.png',
|
||||
)) as any);
|
||||
|
||||
if (!contact) {
|
||||
|
||||
@@ -314,6 +314,8 @@ export class ChannelStartupService {
|
||||
importContacts: data.importContacts,
|
||||
importMessages: data.importMessages,
|
||||
daysLimitImportMessages: data.daysLimitImportMessages,
|
||||
organization: data.organization,
|
||||
logo: data.logo,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user