Skip to content

Commit b6fa434

Browse files
committed
version 1.26.2
1 parent fe05d8f commit b6fa434

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ http://localhost:9876/v15.0/5549988290955/messages \
113113
}'
114114
```
115115

116+
To mark message as read
117+
118+
```sh
119+
curl -i -X POST \
120+
http://localhost:9876/v15.0/5549988290955/messages \
121+
-H 'Content-Type: application/json' \
122+
-H 'Authorization: 1' \
123+
-d '{
124+
"messaging_product": "whatsapp",
125+
"status": "read",
126+
"message_id": "MESSAGE_ID"
127+
}'
128+
```
129+
116130
## Media
117131

118132
To test media

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unoapi-cloud",
3-
"version": "1.26.1",
3+
"version": "1.26.2",
44
"description": "Unoapi Cloud",
55
"exports": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/services/listener_amqp.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ import { eventType, Listener } from './listener'
22
import { EnqueueOption, amqpEnqueue } from '../amqp'
33
import { UNOAPI_JOB_LISTENER } from '../defaults'
44

5+
const priorities = {
6+
'qrcode': 5,
7+
'status': 3,
8+
'history': 0,
9+
'append': 5,
10+
'notify': 5,
11+
'message': 5,
12+
'update': 3,
13+
'delete': 3,
14+
}
15+
516
export class ListenerAmqp implements Listener {
617
private queueListener: string
718

8-
private static priorities = {
9-
qrcode: 5,
10-
status: 3,
11-
history: 0,
12-
append: 5,
13-
notify: 5,
14-
message: 5,
15-
update: 3,
16-
delete: 3,
17-
}
18-
1919
constructor(queueListener = UNOAPI_JOB_LISTENER) {
2020
this.queueListener = queueListener
2121
}
2222

2323
public async process(phone: string, messages: object[], type: eventType) {
2424
const options: Partial<EnqueueOption> = {}
25-
options.priority = ListenerAmqp.priorities[type] || 5
25+
options.priority = priorities[type] || 5
2626
await amqpEnqueue(this.queueListener, phone, { messages, type }, options)
2727
}
2828
}

0 commit comments

Comments
 (0)