From 4880c4264754e1f7c7532fd6ea9a8e349f2049aa Mon Sep 17 00:00:00 2001 From: Artem Titoulenko Date: Wed, 8 Sep 2021 13:01:43 -0400 Subject: [PATCH] send real list of services --- src/communicator.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/communicator.js b/src/communicator.js index e80f1de..59a55f9 100644 --- a/src/communicator.js +++ b/src/communicator.js @@ -72,12 +72,15 @@ class Communicator { switch (tlv.type) { case 0x06: // Requesting available services - const resp = new FLAP(2, this._getNewSequenceNumber(), new SNAC(0x01, 0x03, FLAGS_EMPTY, 0, [ - Buffer.from([0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, - 0x00, 0x06, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0A, - 0x00, 0x0B, 0x00, 0x0C, 0x00, 0x13, 0x00, 0x15, - ]), // Buddy List management service - ])); + // this is just a dword list of service families + const servicesOffered = []; + Object.values(this.services).forEach((service) => { + servicesOffered.push(Buffer.from([0x00, service.family])); + }); + const resp = new FLAP(2, this._getNewSequenceNumber(), + new SNAC(0x01, 0x03, FLAGS_EMPTY, 0, [ + Buffer.concat(servicesOffered), + ])); this.send(resp); return; }