From 6352a931ce1d21fb0038a130a26b8bcf05efcd0e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 8 Jan 2021 23:28:14 +0000 Subject: [PATCH] Instead of checkoing for dms check for public status --- daemon.py | 6 +++--- posts.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 250426cdf..d6bed05da 100644 --- a/daemon.py +++ b/daemon.py @@ -65,7 +65,6 @@ from person import removeAccount from person import canRemovePost from person import personSnooze from person import personUnsnooze -from posts import isDM from posts import isModerator from posts import mutePost from posts import unmutePost @@ -178,6 +177,7 @@ from shares import addShare from shares import removeShare from shares import expireShares from categories import setHashtagCategory +from utils import isPublicPost from utils import getLockedAccount from utils import hasUsersPath from utils import getFullDomain @@ -6997,7 +6997,7 @@ class PubServer(BaseHTTPRequestHandler): # more social graph info if not authorized: pjo = postJsonObject - if isDM(pjo): + if not isPublicPost(pjo): self._404() self.server.GETbusy = False return True @@ -7119,7 +7119,7 @@ class PubServer(BaseHTTPRequestHandler): if not authorized: pjo = postJsonObject self._removePostInteractions(pjo) - if isDM(pjo): + if not isPublicPost(pjo): self._404() self.server.GETbusy = False return True diff --git a/posts.py b/posts.py index e3af38f53..133929a9b 100644 --- a/posts.py +++ b/posts.py @@ -30,6 +30,7 @@ from session import postJsonString from session import postImage from webfinger import webfingerHandle from httpsig import createSignedHeader +from utils import isPublicPost from utils import hasUsersPath from utils import validPostDate from utils import getFullDomain @@ -3091,7 +3092,7 @@ def _createBoxIndexed(recentPostsCache: {}, if not authorized: if p.get('object'): if isinstance(p['object'], dict): - if isDM(p): + if not isPublicPost(p): continue if p['object'].get('likes'): p['likes'] = {'items': []}