Don't send bookmarks to the outbox

main
Bob Mottram 2020-05-21 22:23:34 +01:00
parent b2fdb2b5f9
commit c7c4218fe0
1 changed files with 55 additions and 21 deletions

View File

@ -171,6 +171,8 @@ from schedule import runPostScheduleWatchdog
from schedule import removeScheduledPosts from schedule import removeScheduledPosts
from outbox import postMessageToOutbox from outbox import postMessageToOutbox
from happening import removeCalendarEvent from happening import removeCalendarEvent
from bookmarks import bookmark
from bookmarks import undoBookmark
import os import os
@ -2410,14 +2412,30 @@ class PubServer(BaseHTTPRequestHandler):
bookmarkActor = \ bookmarkActor = \
self.server.httpPrefix + '://' + \ self.server.httpPrefix + '://' + \
self.server.domainFull + '/users/' + self.postToNickname self.server.domainFull + '/users/' + self.postToNickname
bookmarkJson = { # bookmarkJson = {
"@context": "https://www.w3.org/ns/activitystreams", # "@context": "https://www.w3.org/ns/activitystreams",
'type': 'Bookmark', # 'type': 'Bookmark',
'actor': bookmarkActor, # 'actor': bookmarkActor,
'to': [bookmarkActor], # 'to': [bookmarkActor],
'object': bookmarkUrl # 'object': bookmarkUrl
} # }
self._postToOutbox(bookmarkJson, self.server.projectVersion) 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 self.server.GETbusy = False
actorAbsolute = \ actorAbsolute = \
self.server.httpPrefix + '://' + self.server.domainFull + actor self.server.httpPrefix + '://' + self.server.domainFull + actor
@ -2474,19 +2492,35 @@ class PubServer(BaseHTTPRequestHandler):
undoActor = \ undoActor = \
self.server.httpPrefix + '://' + \ self.server.httpPrefix + '://' + \
self.server.domainFull + '/users/' + self.postToNickname self.server.domainFull + '/users/' + self.postToNickname
undoBookmarkJson = { # undoBookmarkJson = {
"@context": "https://www.w3.org/ns/activitystreams", # "@context": "https://www.w3.org/ns/activitystreams",
'type': 'Undo', # 'type': 'Undo',
'actor': undoActor, # 'actor': undoActor,
'to': [undoActor], # 'to': [undoActor],
'object': { # 'object': {
'type': 'Bookmark', # 'type': 'Bookmark',
'actor': undoActor, # 'actor': undoActor,
'to': [undoActor], # 'to': [undoActor],
'object': bookmarkUrl # 'object': bookmarkUrl
} # }
} # }
self._postToOutbox(undoBookmarkJson, self.server.projectVersion) 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 self.server.GETbusy = False
actorAbsolute = \ actorAbsolute = \
self.server.httpPrefix + '://' + self.server.domainFull + actor self.server.httpPrefix + '://' + self.server.domainFull + actor