1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const handlePubrel = (client, packet, done) => {
|
4 | client.log('handling pubrel packet');
|
5 | const callback = typeof done !== 'undefined' ? done : client.noop;
|
6 | const { messageId } = packet;
|
7 | const comp = { cmd: 'pubcomp', messageId };
|
8 | client.incomingStore.get(packet, (err, pub) => {
|
9 | if (!err) {
|
10 | client.emit('message', pub.topic, pub.payload, pub);
|
11 | client.handleMessage(pub, (err2) => {
|
12 | if (err2) {
|
13 | return callback(err2);
|
14 | }
|
15 | client.incomingStore.del(pub, client.noop);
|
16 | client['_sendPacket'](comp, callback);
|
17 | });
|
18 | }
|
19 | else {
|
20 | client['_sendPacket'](comp, callback);
|
21 | }
|
22 | });
|
23 | };
|
24 | exports.default = handlePubrel;
|
25 |
|
\ | No newline at end of file |