diff --git a/lib/messages/search_response.js b/lib/messages/search_response.js index c9d88c6..2e6c9cb 100644 --- a/lib/messages/search_response.js +++ b/lib/messages/search_response.js @@ -74,7 +74,10 @@ SearchResponse.prototype.send = function (entry, nofiltering) { entry = new SearchEntry({ objectName: typeof (save.dn) === 'string' ? parseDN(save.dn) : save.dn, messageId: self.messageId, - attributes: Attribute.fromObject(entry.attributes) + attributes: Attribute.fromObject(entry.attributes), + getAttribute: function(a) { + this.attributes.filter(f => f.type === a).map(m -> m.values).pop() + } }) } @@ -100,7 +103,8 @@ SearchResponse.prototype.createSearchEntry = function (object) { const entry = new SearchEntry({ messageId: this.messageId, objectName: object.objectName || object.dn, - attributes: object.attributes ?? [] + attributes: object.attributes ?? [], + getAttribute: object.getAttribute ?? function() { return null } }) return entry }