From bc58077eea3ef9dcbfce1995809a6c40117a4e73 Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Wed, 30 Nov 2022 21:33:14 +0000
Subject: [PATCH] Move button
---
daemon.py | 23 +++++++++++++++++++++++
webapp_person_options.py | 13 ++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/daemon.py b/daemon.py
index 511ed7470..e8c0e20a6 100644
--- a/daemon.py
+++ b/daemon.py
@@ -3007,6 +3007,11 @@ class PubServer(BaseHTTPRequestHandler):
if '&' in options_actor:
options_actor = options_actor.split('&')[0]
+ # actor for the movedTo
+ options_actor_moved = options_confirm_params.split('movedToActor=')[1]
+ if '&' in options_actor_moved:
+ options_actor_moved = options_actor_moved.split('&')[0]
+
# url of the avatar
options_avatar_url = options_confirm_params.split('avatarUrl=')[1]
if '&' in options_avatar_url:
@@ -3414,6 +3419,24 @@ class PubServer(BaseHTTPRequestHandler):
self.server.postreq_busy = False
return
+ # person options screen, move button
+ # See html_person_options followStr
+ if '&submitMove=' in options_confirm_params:
+ if debug:
+ print('Moving ' + options_actor_moved)
+ msg = \
+ html_confirm_follow(self.server.translate,
+ base_dir,
+ users_path,
+ options_actor_moved,
+ options_avatar_url).encode('utf-8')
+ msglen = len(msg)
+ self._set_headers('text/html', msglen,
+ cookie, calling_domain, False)
+ self._write(msg)
+ self.server.postreq_busy = False
+ return
+
# person options screen, unfollow button
# See html_person_options followStr
if '&submitUnfollow=' in options_confirm_params or \
diff --git a/webapp_person_options.py b/webapp_person_options.py
index f946a74a1..23557e63e 100644
--- a/webapp_person_options.py
+++ b/webapp_person_options.py
@@ -217,6 +217,10 @@ def html_person_options(default_timeline: str,
options_link_str = \
' \n'
+ if moved_to:
+ options_link_str += \
+ ' \n'
css_filename = base_dir + '/epicyon-options.css'
if os.path.isfile(base_dir + '/options.css'):
css_filename = base_dir + '/options.css'
@@ -309,7 +313,14 @@ def html_person_options(default_timeline: str,
' ' + \
translate['New account'] + \
': @' + new_handle + '' + \
- blocked_icon_str + '
\n'
+ blocked_icon_str
+ if follow_str == 'Unfollow' and not blocked_icon_str:
+ options_str += \
+ ''
+ options_str += '
\n'
elif also_known_as:
other_accounts_html = \
' ' + \