From 8b0b378d3a87b042182619cd9509f9a283239c1a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 13 Apr 2024 12:02:54 +0100 Subject: [PATCH] Tidying --- daemon_post.py | 5 ++++- daemon_post_remove.py | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/daemon_post.py b/daemon_post.py index 66ad0de99..a6ff28605 100644 --- a/daemon_post.py +++ b/daemon_post.py @@ -392,7 +392,10 @@ def daemon_http_post(self) -> None: self.server.domain_full, self.server.onion_domain, self.server.i2p_domain, - curr_session, proxy_type) + curr_session, proxy_type, + self.server.person_cache, + self.server.max_shares_on_profile, + self.server.project_version) self.server.postreq_busy = False return diff --git a/daemon_post_remove.py b/daemon_post_remove.py index 3d1ae26c2..91c9daa99 100644 --- a/daemon_post_remove.py +++ b/daemon_post_remove.py @@ -111,7 +111,10 @@ def remove_share(self, calling_domain: str, cookie: str, authorized: bool, path: str, base_dir: str, http_prefix: str, domain_full: str, onion_domain: str, i2p_domain: str, - curr_session, proxy_type: str) -> None: + curr_session, proxy_type: str, + person_cache: {}, + max_shares_on_profile: int, + project_version: str) -> None: """Removes a shared item """ users_path = path.split('/rmshare')[0] @@ -180,7 +183,6 @@ def remove_share(self, calling_domain: str, cookie: str, onion_domain, i2p_domain) + \ '/users/' + share_nickname - person_cache = self.server.person_cache actor_json = get_person_from_cache(base_dir, actor, person_cache) if not actor_json: @@ -190,8 +192,6 @@ def remove_share(self, calling_domain: str, cookie: str, if os.path.isfile(actor_filename): actor_json = load_json(actor_filename, 1, 1) if actor_json: - max_shares_on_profile = \ - self.server.max_shares_on_profile if add_shares_to_actor(base_dir, share_nickname, share_domain, actor_json, @@ -212,7 +212,7 @@ def remove_share(self, calling_domain: str, cookie: str, 'after change to attached shares 2: ' + str(update_actor_json)) post_to_outbox(self, update_actor_json, - self.server.project_version, + project_version, share_nickname, curr_session, proxy_type)