Skip to content

Commit 763e30b

Browse files
committed
fix: fix in update settings that needed to restart after updated
1 parent 5121374 commit 763e30b

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.3.2 (homolog)
2+
3+
### Fixed
4+
5+
* Fix in update settings that needed to restart after updated
6+
17
# 1.3.1 (2023-07-20 07:48)
28

39
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolution-api",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Rest api for communication with WhatsApp",
55
"main": "./dist/src/main.js",
66
"scripts": {

src/whatsapp/services/whatsapp.service.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,9 @@ export class WAStartupService {
23642364
public async fetchMessages(query: MessageQuery) {
23652365
this.logger.verbose('Fetching messages');
23662366
if (query?.where) {
2367+
if (query.where?.key?.remoteJid) {
2368+
query.where.key.remoteJid = this.createJid(query.where.key.remoteJid);
2369+
}
23672370
query.where.owner = this.instance.name;
23682371
} else {
23692372
query = {
@@ -2379,6 +2382,9 @@ export class WAStartupService {
23792382
public async fetchStatusMessage(query: MessageUpQuery) {
23802383
this.logger.verbose('Fetching status messages');
23812384
if (query?.where) {
2385+
if (query.where?.remoteJid) {
2386+
query.where.remoteJid = this.createJid(query.where.remoteJid);
2387+
}
23822388
query.where.owner = this.instance.name;
23832389
} else {
23842390
query = {
@@ -2423,8 +2429,19 @@ export class WAStartupService {
24232429
this.logger.verbose('Groups add privacy updated');
24242430

24252431
// reinicia a instancia
2432+
this.client?.ws?.close();
24262433

2427-
return { update: 'success', data: await this.client.fetchPrivacySettings() };
2434+
return {
2435+
update: 'success',
2436+
data: {
2437+
readreceipts: settings.privacySettings.readreceipts,
2438+
profile: settings.privacySettings.profile,
2439+
status: settings.privacySettings.status,
2440+
online: settings.privacySettings.online,
2441+
last: settings.privacySettings.last,
2442+
groupadd: settings.privacySettings.groupadd,
2443+
},
2444+
};
24282445
} catch (error) {
24292446
throw new InternalServerErrorException(
24302447
'Error updating privacy settings',

0 commit comments

Comments
 (0)