Simplify human conversation and hide internal audit envelopes
This commit is contained in:
@@ -341,6 +341,15 @@ class Store:
|
||||
rows = db.execute('SELECT * FROM (SELECT * FROM messages WHERE session_id=? ORDER BY created DESC LIMIT 500) ORDER BY created', (sid,)).fetchall()
|
||||
return [self.public_message(row) for row in rows]
|
||||
|
||||
def conversation(self, sid):
|
||||
from .conversation import project
|
||||
sid = identifier(sid)
|
||||
with self.db() as db:
|
||||
self._get(db, 'sessions', sid)
|
||||
rows = db.execute('SELECT * FROM (SELECT * FROM messages WHERE session_id=? ORDER BY created DESC LIMIT 500) ORDER BY created', (sid,)).fetchall()
|
||||
links = [json.loads(row['data']) for row in db.execute('SELECT data FROM history_links WHERE session_id=?', (sid,))]
|
||||
return project([dict(row) for row in rows], links)
|
||||
|
||||
def claim(self, data):
|
||||
sid, worker = identifier(data.get('session_id')), identifier(data.get('worker_id'))
|
||||
seconds = data.get('lease_seconds', 300)
|
||||
|
||||
Reference in New Issue
Block a user