mirror of https://gitlab.com/bashrc2/epicyon
Avoid duplication
parent
803fed70b0
commit
4030055ff5
|
@ -34,6 +34,24 @@ from session import establish_session
|
||||||
from daemon_utils import show_person_options
|
from daemon_utils import show_person_options
|
||||||
|
|
||||||
|
|
||||||
|
def _receive_search_redirect(self, calling_domain: str,
|
||||||
|
http_prefix: str,
|
||||||
|
domain_full: str,
|
||||||
|
onion_domain: str,
|
||||||
|
i2p_domain: str,
|
||||||
|
users_path: str,
|
||||||
|
default_timeline: str,
|
||||||
|
cookie: str) -> None:
|
||||||
|
"""Redirect to a different screen after search
|
||||||
|
"""
|
||||||
|
actor_str = \
|
||||||
|
get_instance_url(calling_domain, http_prefix,
|
||||||
|
domain_full, onion_domain, i2p_domain) + users_path
|
||||||
|
redirect_headers(self, actor_str + '/' + default_timeline,
|
||||||
|
cookie, calling_domain, 303)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
|
|
||||||
def receive_search_query(self, calling_domain: str, cookie: str,
|
def receive_search_query(self, calling_domain: str, cookie: str,
|
||||||
authorized: bool, path: str,
|
authorized: bool, path: str,
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
|
@ -119,12 +137,11 @@ def receive_search_query(self, calling_domain: str, cookie: str,
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
if 'searchtext=' not in search_params:
|
if 'searchtext=' not in search_params:
|
||||||
actor_str = \
|
_receive_search_redirect(self, calling_domain,
|
||||||
get_instance_url(calling_domain, http_prefix, domain_full,
|
http_prefix, domain_full,
|
||||||
onion_domain, i2p_domain) + users_path
|
onion_domain, i2p_domain,
|
||||||
redirect_headers(self, actor_str + '/' + default_timeline,
|
users_path, default_timeline,
|
||||||
cookie, calling_domain, 303)
|
cookie)
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
search_str = search_params.split('searchtext=')[1]
|
search_str = search_params.split('searchtext=')[1]
|
||||||
|
@ -612,9 +629,8 @@ def receive_search_query(self, calling_domain: str, cookie: str,
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
actor_str = \
|
_receive_search_redirect(self, calling_domain,
|
||||||
get_instance_url(calling_domain, http_prefix,
|
http_prefix, domain_full,
|
||||||
domain_full, onion_domain, i2p_domain) + users_path
|
onion_domain, i2p_domain,
|
||||||
redirect_headers(self, actor_str + '/' + default_timeline,
|
users_path, default_timeline,
|
||||||
cookie, calling_domain, 303)
|
cookie)
|
||||||
self.server.postreq_busy = False
|
|
||||||
|
|
Loading…
Reference in New Issue