Edit links endpoint

main
Bob Mottram 2020-10-01 20:42:10 +01:00
parent e0c0269d5f
commit de97668fd2
1 changed files with 33 additions and 0 deletions

View File

@ -144,6 +144,7 @@ from webinterface import htmlSearchEmojiTextEntry
from webinterface import htmlUnfollowConfirm from webinterface import htmlUnfollowConfirm
from webinterface import htmlProfileAfterSearch from webinterface import htmlProfileAfterSearch
from webinterface import htmlEditProfile from webinterface import htmlEditProfile
from webinterface import htmlEditLinks
from webinterface import htmlTermsOfService from webinterface import htmlTermsOfService
from webinterface import htmlSkillsSearch from webinterface import htmlSkillsSearch
from webinterface import htmlHistorySearch from webinterface import htmlHistorySearch
@ -7413,6 +7414,28 @@ class PubServer(BaseHTTPRequestHandler):
return True return True
return False 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, def _editEvent(self, callingDomain: str, path: str,
httpPrefix: str, domain: str, domainFull: str, httpPrefix: str, domain: str, domainFull: str,
baseDir: str, translate: {}, baseDir: str, translate: {},
@ -8707,6 +8730,16 @@ class PubServer(BaseHTTPRequestHandler):
cookie): cookie):
return 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, if self._showNewPost(callingDomain, self.path,
self.server.mediaInstance, self.server.mediaInstance,
self.server.translate, self.server.translate,