diff --git a/daemon.py b/daemon.py index bee03e79..9367cc30 100644 --- a/daemon.py +++ b/daemon.py @@ -2143,13 +2143,33 @@ class PubServer(BaseHTTPRequestHandler): if moderationButton=='unsuspend': unsuspendAccount(self.server.baseDir,nickname) if moderationButton=='block': - fullBlockDomain=moderationText.split('@')[1] - addGlobalBlock(self.server.baseDir, \ - nickname,fullBlockDomain) + fullBlockDomain=None + if moderationText.startswith('http') or \ + moderationText.startswith('dat'): + blockDomain,blockPort=getDomainFromActor(moderationText) + fullBlockDomain=blockDomain + if blockPort: + if blockPort!=80 and blockPort!=443: + fullBlockDomain=blockDomain+':'+str(blockPort) + if '@' in moderationText: + fullBlockDomain=moderationText.split('@')[1] + if fullBlockDomain: + addGlobalBlock(self.server.baseDir, \ + nickname,fullBlockDomain) if moderationButton=='unblock': - fullBlockDomain=moderationText.split('@')[1] - removeGlobalBlock(self.server.baseDir, \ - nickname,fullBlockDomain) + fullBlockDomain=None + if moderationText.startswith('http') or \ + moderationText.startswith('dat'): + blockDomain,blockPort=getDomainFromActor(moderationText) + fullBlockDomain=blockDomain + if blockPort: + if blockPort!=80 and blockPort!=443: + fullBlockDomain=blockDomain+':'+str(blockPort) + if '@' in moderationText: + fullBlockDomain=moderationText.split('@')[1] + if fullBlockDomain: + removeGlobalBlock(self.server.baseDir, \ + nickname,fullBlockDomain) if moderationButton=='remove': if '/statuses/' not in moderationText: removeAccount(self.server.baseDir, \ diff --git a/webinterface.py b/webinterface.py index 75042294..6c77caa7 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1069,7 +1069,7 @@ def htmlTimeline(pageNumber: int,itemsPerPage: int,session,baseDir: str, \ tlStr+= \ '