mirror of https://gitlab.com/bashrc2/epicyon
Fix moderation report sending
parent
c498e79b14
commit
33cbe80c20
|
@ -2183,6 +2183,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
postState=self._receiveNewPost(authorized,'newfollowers')
|
||||
if postState!=0:
|
||||
nickname=self.path.split('/users/')[1]
|
||||
if '/' in nickname:
|
||||
nickname=nickname.split('/')[0]
|
||||
self._redirect_headers('/users/'+self.postToNickname+'/outbox',cookie)
|
||||
|
@ -2190,6 +2191,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
postState=self._receiveNewPost(authorized,'newdm')
|
||||
if postState!=0:
|
||||
nickname=self.path.split('/users/')[1]
|
||||
if '/' in nickname:
|
||||
nickname=nickname.split('/')[0]
|
||||
self._redirect_headers('/users/'+self.postToNickname+'/outbox',cookie)
|
||||
|
@ -2197,6 +2199,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
postState=self._receiveNewPost(authorized,'newreport')
|
||||
if postState!=0:
|
||||
nickname=self.path.split('/users/')[1]
|
||||
if '/' in nickname:
|
||||
nickname=nickname.split('/')[0]
|
||||
self._redirect_headers('/users/'+self.postToNickname+'/outbox',cookie)
|
||||
|
@ -2204,6 +2207,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
postState=self._receiveNewPost(authorized,'newshare')
|
||||
if postState!=0:
|
||||
nickname=self.path.split('/users/')[1]
|
||||
if '/' in nickname:
|
||||
nickname=nickname.split('/')[0]
|
||||
self._redirect_headers('/users/'+self.postToNickname+'/shares',cookie)
|
||||
|
|
13
posts.py
13
posts.py
|
@ -428,6 +428,11 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
|
|||
summary=subject
|
||||
sensitive=True
|
||||
|
||||
if toUrl:
|
||||
if not isinstance(toUrl, str):
|
||||
print('ERROR: toUrl is not a string')
|
||||
return None
|
||||
|
||||
# who to send to
|
||||
toRecipients=[toUrl] + mentionedRecipients
|
||||
|
||||
|
@ -810,12 +815,16 @@ def createReportPost(baseDir: str,
|
|||
print(str(moderatorsList))
|
||||
postTo=moderatorsList
|
||||
postCc=None
|
||||
return createPostBase(baseDir,nickname, domain, port, \
|
||||
postTo,postCc, \
|
||||
postJsonObject=None
|
||||
for toUrl in postTo:
|
||||
postJsonObject= \
|
||||
createPostBase(baseDir,nickname, domain, port, \
|
||||
toUrl,postCc, \
|
||||
httpPrefix, content, followersOnly, saveToFile, \
|
||||
clientToServer, \
|
||||
attachImageFilename,imageDescription,useBlurhash, \
|
||||
None, None, subject)
|
||||
return postJsonObject
|
||||
|
||||
def threadSendPost(session,postJsonObject: {},federationList: [],\
|
||||
inboxUrl: str, baseDir: str,signatureHeaderJson: {},postLog: [],
|
||||
|
|
Loading…
Reference in New Issue