mirror of https://gitlab.com/bashrc2/epicyon
Move edit event screen to its own method
parent
2a2279b05c
commit
9a1de6d012
74
daemon.py
74
daemon.py
|
@ -7202,6 +7202,43 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def _editEvent(self, callingDomain: str, path: str,
|
||||||
|
httpPrefix: str, domain: str, domainFull: str,
|
||||||
|
baseDir: str, translate: {},
|
||||||
|
mediaInstance: bool,
|
||||||
|
cookie: str) -> bool:
|
||||||
|
"""Show edit event screen
|
||||||
|
"""
|
||||||
|
messageId = path.split('?editeventpost=')[1]
|
||||||
|
if '?' in messageId:
|
||||||
|
messageId = messageId.split('?')[0]
|
||||||
|
actor = path.split('?actor=')[1]
|
||||||
|
if '?' in actor:
|
||||||
|
actor = actor.split('?')[0]
|
||||||
|
nickname = getNicknameFromActor(path)
|
||||||
|
if nickname == actor:
|
||||||
|
# postUrl = \
|
||||||
|
# httpPrefix + '://' + \
|
||||||
|
# domainFull + '/users/' + nickname + \
|
||||||
|
# '/statuses/' + messageId
|
||||||
|
msg = None
|
||||||
|
# TODO
|
||||||
|
# htmlEditEvent(mediaInstance,
|
||||||
|
# translate,
|
||||||
|
# baseDir,
|
||||||
|
# httpPrefix,
|
||||||
|
# path,
|
||||||
|
# nickname, domain,
|
||||||
|
# postUrl)
|
||||||
|
if msg:
|
||||||
|
msg = msg.encode('utf-8')
|
||||||
|
self._set_headers('text/html', len(msg),
|
||||||
|
cookie, callingDomain)
|
||||||
|
self._write(msg)
|
||||||
|
self.server.GETbusy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
callingDomain = self.server.domainFull
|
callingDomain = self.server.domainFull
|
||||||
if self.headers.get('Host'):
|
if self.headers.get('Host'):
|
||||||
|
@ -8426,34 +8463,15 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'/tlevents' in self.path and \
|
'/tlevents' in self.path and \
|
||||||
'?editeventpost=' in self.path and \
|
'?editeventpost=' in self.path and \
|
||||||
'?actor=' in self.path:
|
'?actor=' in self.path:
|
||||||
messageId = self.path.split('?editeventpost=')[1]
|
if self._editEvent(callingDomain, self.path,
|
||||||
if '?' in messageId:
|
self.server.httpPrefix,
|
||||||
messageId = messageId.split('?')[0]
|
self.server.domain,
|
||||||
actor = self.path.split('?actor=')[1]
|
self.server.domainFull,
|
||||||
if '?' in actor:
|
self.server.baseDir,
|
||||||
actor = actor.split('?')[0]
|
self.server.translate,
|
||||||
nickname = getNicknameFromActor(self.path)
|
self.server.mediaInstance,
|
||||||
if nickname == actor:
|
cookie):
|
||||||
postUrl = \
|
return
|
||||||
self.server.httpPrefix + '://' + \
|
|
||||||
self.server.domainFull + '/users/' + nickname + \
|
|
||||||
'/statuses/' + messageId
|
|
||||||
msg = None
|
|
||||||
# TODO
|
|
||||||
# htmlEditEvent(self.server.mediaInstance,
|
|
||||||
# self.server.translate,
|
|
||||||
# self.server.baseDir,
|
|
||||||
# self.server.httpPrefix,
|
|
||||||
# self.path,
|
|
||||||
# nickname, self.server.domain,
|
|
||||||
# postUrl)
|
|
||||||
if msg:
|
|
||||||
msg = msg.encode('utf-8')
|
|
||||||
self._set_headers('text/html', len(msg),
|
|
||||||
cookie, callingDomain)
|
|
||||||
self._write(msg)
|
|
||||||
self.server.GETbusy = False
|
|
||||||
return
|
|
||||||
|
|
||||||
# edit profile in web interface
|
# edit profile in web interface
|
||||||
if self._editProfile(callingDomain, self.path,
|
if self._editProfile(callingDomain, self.path,
|
||||||
|
|
Loading…
Reference in New Issue