From 97da1aee50af959838fdaed3b85eb4fb47627ff0 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 28 Jan 2020 10:21:49 -0500 Subject: Optimize /about-diff - Include rel/type in links query - Query only own messages for self-about (unless fromAny=1) --- lib/app.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/app.js') diff --git a/lib/app.js b/lib/app.js index d0ff7f4..c841ab0 100644 --- a/lib/app.js +++ b/lib/app.js @@ -1337,7 +1337,7 @@ App.prototype.getLinks = function (id) { }) } -App.prototype.getLinks2 = function (id, relOrType) { +App.prototype.getLinksBy = function (id, relOrType) { return this.sbot.backlinks ? this.sbot.backlinks.read({ query: [ {$filter: { @@ -1357,6 +1357,16 @@ App.prototype.getLinks2 = function (id, relOrType) { }) } +App.prototype.getLinks3 = function (id, author, rel) { + return this.sbotLinks({ + dest: id, + source: author, + rel: rel, + meta: false, + values: true + }) +} + App.prototype.getShard = function (id, cb) { var self = this this.getMsgDecrypted(id, function (err, msg) { -- cgit v1.2.3