Simplify human conversation and hide internal audit envelopes
This commit is contained in:
@@ -188,11 +188,12 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self.output(200, state)
|
||||
elif parts.path == '/api/hook-notifications' and not parts.query:
|
||||
self.output(200, self.server.store.hook_notifications())
|
||||
elif parts.path == '/api/messages':
|
||||
elif parts.path in ('/api/messages','/api/conversation'):
|
||||
query = parse_qs(parts.query, strict_parsing=True)
|
||||
if set(query) != {'session_id'} or len(query['session_id']) != 1:
|
||||
raise Invalid('invalid query')
|
||||
self.output(200, {'messages':self.server.store.messages(query['session_id'][0])})
|
||||
reader = self.server.store.conversation if parts.path == '/api/conversation' else self.server.store.messages
|
||||
self.output(200, {'messages':reader(query['session_id'][0])})
|
||||
else:
|
||||
self.output(404, {'error':'not found'})
|
||||
except (Invalid,ValueError):
|
||||
|
||||
Reference in New Issue
Block a user