mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
c168cb436d
29
daemon.py
29
daemon.py
|
|
@ -2186,18 +2186,23 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if '&' in moderation_params:
|
if '&' in moderation_params:
|
||||||
moderation_text = None
|
moderation_text = None
|
||||||
moderation_button = None
|
moderation_button = None
|
||||||
|
# get the moderation text first
|
||||||
|
actStr = 'moderationAction='
|
||||||
for moderation_str in moderation_params.split('&'):
|
for moderation_str in moderation_params.split('&'):
|
||||||
if moderation_str.startswith('moderationAction'):
|
if moderation_str.startswith(actStr):
|
||||||
if '=' in moderation_str:
|
if actStr in moderation_str:
|
||||||
moderation_text = \
|
moderation_text = \
|
||||||
moderation_str.split('=')[1].strip()
|
moderation_str.split(actStr)[1].strip()
|
||||||
mod_text = moderation_text.replace('+', ' ')
|
mod_text = moderation_text.replace('+', ' ')
|
||||||
moderation_text = \
|
moderation_text = \
|
||||||
urllib.parse.unquote_plus(mod_text.strip())
|
urllib.parse.unquote_plus(mod_text.strip())
|
||||||
elif moderation_str.startswith('submitInfo'):
|
# which button was pressed?
|
||||||
if '=' in moderation_str:
|
for moderation_str in moderation_params.split('&'):
|
||||||
|
if moderation_str.startswith('submitInfo='):
|
||||||
|
if not moderation_text and \
|
||||||
|
'submitInfo=' in moderation_str:
|
||||||
moderation_text = \
|
moderation_text = \
|
||||||
moderation_str.split('=')[1].strip()
|
moderation_str.split('submitInfo=')[1].strip()
|
||||||
mod_text = moderation_text.replace('+', ' ')
|
mod_text = moderation_text.replace('+', ' ')
|
||||||
moderation_text = \
|
moderation_text = \
|
||||||
urllib.parse.unquote_plus(mod_text.strip())
|
urllib.parse.unquote_plus(mod_text.strip())
|
||||||
|
|
@ -2212,7 +2217,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
search_handle = \
|
search_handle = \
|
||||||
search_nickname + '@' + search_domain
|
search_nickname + '@' + search_domain
|
||||||
else:
|
else:
|
||||||
search_handle = None
|
search_handle = ''
|
||||||
if '@' not in search_handle:
|
if '@' not in search_handle:
|
||||||
if search_handle.startswith('http'):
|
if search_handle.startswith('http'):
|
||||||
search_nickname = \
|
search_nickname = \
|
||||||
|
|
@ -2223,7 +2228,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
search_handle = \
|
search_handle = \
|
||||||
search_nickname + '@' + search_domain
|
search_nickname + '@' + search_domain
|
||||||
else:
|
else:
|
||||||
search_handle = None
|
search_handle = ''
|
||||||
if '@' not in search_handle:
|
if '@' not in search_handle:
|
||||||
# is this a local nickname on this instance?
|
# is this a local nickname on this instance?
|
||||||
local_handle = \
|
local_handle = \
|
||||||
|
|
@ -2232,8 +2237,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'/accounts/' + local_handle):
|
'/accounts/' + local_handle):
|
||||||
search_handle = local_handle
|
search_handle = local_handle
|
||||||
else:
|
else:
|
||||||
search_handle = None
|
search_handle = ''
|
||||||
if search_handle:
|
if search_handle is None:
|
||||||
|
search_handle = ''
|
||||||
|
if '@' in search_handle:
|
||||||
msg = \
|
msg = \
|
||||||
html_account_info(self.server.css_cache,
|
html_account_info(self.server.css_cache,
|
||||||
self.server.translate,
|
self.server.translate,
|
||||||
|
|
@ -2259,7 +2266,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
elif moderation_str.startswith('submitBlock'):
|
if moderation_str.startswith('submitBlock'):
|
||||||
moderation_button = 'block'
|
moderation_button = 'block'
|
||||||
elif moderation_str.startswith('submitUnblock'):
|
elif moderation_str.startswith('submitUnblock'):
|
||||||
moderation_button = 'unblock'
|
moderation_button = 'unblock'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue