From de97668fd2f6f4d6009eb75c7bf08463dfe62048 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 1 Oct 2020 20:42:10 +0100 Subject: [PATCH] Edit links endpoint --- daemon.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/daemon.py b/daemon.py index ea25ca15..3a744a62 100644 --- a/daemon.py +++ b/daemon.py @@ -144,6 +144,7 @@ from webinterface import htmlSearchEmojiTextEntry from webinterface import htmlUnfollowConfirm from webinterface import htmlProfileAfterSearch from webinterface import htmlEditProfile +from webinterface import htmlEditLinks from webinterface import htmlTermsOfService from webinterface import htmlSkillsSearch from webinterface import htmlHistorySearch @@ -7413,6 +7414,28 @@ class PubServer(BaseHTTPRequestHandler): return True return False + def _editLinks(self, callingDomain: str, path: str, + translate: {}, baseDir: str, + httpPrefix: str, domain: str, port: int, + cookie: str) -> bool: + """Show the links from the left column + """ + if '/users/' in path and path.endswith('/editlinks'): + msg = htmlEditLinks(translate, + baseDir, + path, domain, + port, + httpPrefix).encode('utf-8') + if msg: + self._set_headers('text/html', len(msg), + cookie, callingDomain) + self._write(msg) + else: + self._404() + self.server.GETbusy = False + return True + return False + def _editEvent(self, callingDomain: str, path: str, httpPrefix: str, domain: str, domainFull: str, baseDir: str, translate: {}, @@ -8707,6 +8730,16 @@ class PubServer(BaseHTTPRequestHandler): cookie): return + # edit links from the left column of the timeline in web interface + if self._editLinks(callingDomain, self.path, + self.server.translate, + self.server.baseDir, + self.server.httpPrefix, + self.server.domain, + self.server.port, + cookie): + return + if self._showNewPost(callingDomain, self.path, self.server.mediaInstance, self.server.translate,