From c7c4218fe00b15211580e77cc775c1e3561afe0d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 21 May 2020 22:23:34 +0100 Subject: [PATCH] Don't send bookmarks to the outbox --- daemon.py | 76 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 21 deletions(-) diff --git a/daemon.py b/daemon.py index 25c859ac..dffe584f 100644 --- a/daemon.py +++ b/daemon.py @@ -171,6 +171,8 @@ from schedule import runPostScheduleWatchdog from schedule import removeScheduledPosts from outbox import postMessageToOutbox from happening import removeCalendarEvent +from bookmarks import bookmark +from bookmarks import undoBookmark import os @@ -2410,14 +2412,30 @@ class PubServer(BaseHTTPRequestHandler): bookmarkActor = \ self.server.httpPrefix + '://' + \ self.server.domainFull + '/users/' + self.postToNickname - bookmarkJson = { - "@context": "https://www.w3.org/ns/activitystreams", - 'type': 'Bookmark', - 'actor': bookmarkActor, - 'to': [bookmarkActor], - 'object': bookmarkUrl - } - self._postToOutbox(bookmarkJson, self.server.projectVersion) + # bookmarkJson = { + # "@context": "https://www.w3.org/ns/activitystreams", + # 'type': 'Bookmark', + # 'actor': bookmarkActor, + # 'to': [bookmarkActor], + # 'object': bookmarkUrl + # } + ccList = [] + bookmark(self.server.recentPostsCache, + self.server.session, + self.server.baseDir, + self.server.federationList, + self.postToNickname, + self.server.domain, self.server.port, + ccList, + self.server.httpPrefix, + bookmarkUrl, bookmarkActor, False, + self.server.sendThreads, + self.server.postLog, + self.server.personCache, + self.server.cachedWebfingers, + self.server.debug, + self.server.projectVersion) + # self._postToOutbox(bookmarkJson, self.server.projectVersion) self.server.GETbusy = False actorAbsolute = \ self.server.httpPrefix + '://' + self.server.domainFull + actor @@ -2474,19 +2492,35 @@ class PubServer(BaseHTTPRequestHandler): undoActor = \ self.server.httpPrefix + '://' + \ self.server.domainFull + '/users/' + self.postToNickname - undoBookmarkJson = { - "@context": "https://www.w3.org/ns/activitystreams", - 'type': 'Undo', - 'actor': undoActor, - 'to': [undoActor], - 'object': { - 'type': 'Bookmark', - 'actor': undoActor, - 'to': [undoActor], - 'object': bookmarkUrl - } - } - self._postToOutbox(undoBookmarkJson, self.server.projectVersion) + # undoBookmarkJson = { + # "@context": "https://www.w3.org/ns/activitystreams", + # 'type': 'Undo', + # 'actor': undoActor, + # 'to': [undoActor], + # 'object': { + # 'type': 'Bookmark', + # 'actor': undoActor, + # 'to': [undoActor], + # 'object': bookmarkUrl + # } + # } + ccList = [] + undoBookmark(self.server.recentPostsCache, + self.server.session, + self.server.baseDir, + self.server.federationList, + self.postToNickname, + self.server.domain, self.server.port, + ccList, + self.server.httpPrefix, + bookmarkUrl, undoActor, False, + self.server.sendThreads, + self.server.postLog, + self.server.personCache, + self.server.cachedWebfingers, + self.server.debug, + self.server.projectVersion) + # self._postToOutbox(undoBookmarkJson, self.server.projectVersion) self.server.GETbusy = False actorAbsolute = \ self.server.httpPrefix + '://' + self.server.domainFull + actor