Instead of checkoing for dms check for public status

main
Bob Mottram 2021-01-08 23:28:14 +00:00
parent 55bec518c0
commit 6352a931ce
2 changed files with 5 additions and 4 deletions

View File

@ -65,7 +65,6 @@ from person import removeAccount
from person import canRemovePost from person import canRemovePost
from person import personSnooze from person import personSnooze
from person import personUnsnooze from person import personUnsnooze
from posts import isDM
from posts import isModerator from posts import isModerator
from posts import mutePost from posts import mutePost
from posts import unmutePost from posts import unmutePost
@ -178,6 +177,7 @@ from shares import addShare
from shares import removeShare from shares import removeShare
from shares import expireShares from shares import expireShares
from categories import setHashtagCategory from categories import setHashtagCategory
from utils import isPublicPost
from utils import getLockedAccount from utils import getLockedAccount
from utils import hasUsersPath from utils import hasUsersPath
from utils import getFullDomain from utils import getFullDomain
@ -6997,7 +6997,7 @@ class PubServer(BaseHTTPRequestHandler):
# more social graph info # more social graph info
if not authorized: if not authorized:
pjo = postJsonObject pjo = postJsonObject
if isDM(pjo): if not isPublicPost(pjo):
self._404() self._404()
self.server.GETbusy = False self.server.GETbusy = False
return True return True
@ -7119,7 +7119,7 @@ class PubServer(BaseHTTPRequestHandler):
if not authorized: if not authorized:
pjo = postJsonObject pjo = postJsonObject
self._removePostInteractions(pjo) self._removePostInteractions(pjo)
if isDM(pjo): if not isPublicPost(pjo):
self._404() self._404()
self.server.GETbusy = False self.server.GETbusy = False
return True return True

View File

@ -30,6 +30,7 @@ from session import postJsonString
from session import postImage from session import postImage
from webfinger import webfingerHandle from webfinger import webfingerHandle
from httpsig import createSignedHeader from httpsig import createSignedHeader
from utils import isPublicPost
from utils import hasUsersPath from utils import hasUsersPath
from utils import validPostDate from utils import validPostDate
from utils import getFullDomain from utils import getFullDomain
@ -3091,7 +3092,7 @@ def _createBoxIndexed(recentPostsCache: {},
if not authorized: if not authorized:
if p.get('object'): if p.get('object'):
if isinstance(p['object'], dict): if isinstance(p['object'], dict):
if isDM(p): if not isPublicPost(p):
continue continue
if p['object'].get('likes'): if p['object'].get('likes'):
p['likes'] = {'items': []} p['likes'] = {'items': []}