From 75605bcf3462b8dbb165a5e7056f562d6eeb1e03 Mon Sep 17 00:00:00 2001 From: buhe Date: Fri, 29 Jul 2022 22:30:05 +0800 Subject: [PATCH] set client meta --- lib/Connection.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index bd31e98b..2201e026 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -68,6 +68,7 @@ function Connection(config) { password: config.password, xoauth: config.xoauth, xoauth2: config.xoauth2, + id: config.id ? config.id : null, connTimeout: config.connTimeout || 10000, authTimeout: config.authTimeout || 5000, keepalive: (config.keepalive === undefined || config.keepalive === null @@ -1613,7 +1614,10 @@ Connection.prototype._login = function() { self.emit('error', err); return self._sock.end(); } - + // set client meta + if (self._config.id) { + self._enqueue(`ID ("name" "${escape(self._config.id.name)}" "version" "${escape(self._config.id.version)}" "vendor" "${escape(self._config.id.vendor)}")`, reentry); + } // 2. Get the list of available namespaces (RFC2342) if (!checkedNS && self.serverSupports('NAMESPACE')) { checkedNS = true;