paginated user comment screens

This commit is contained in:
Doug Hoyte
2023-09-28 16:20:50 -04:00
parent 1584705a44
commit 1f7a0d2ade
5 changed files with 70 additions and 8 deletions

View File

@ -217,7 +217,14 @@ HTTPResponse WebServer::generateReadResponse(lmdb::txn &txn, Decompressor &decom
}
if (u.path[2] == "notes") {
UserEvents uc(txn, decomp, userPubkey);
uint64_t resumeTime = MAX_U64;
try {
auto resumeTimeStr = u.lookupQuery("next");
if (resumeTimeStr) resumeTime = std::stoull(std::string(*resumeTimeStr));
} catch(...) {}
UserEvents uc(txn, decomp, userPubkey, resumeTime);
title = std::string("notes: ") + uc.u.username;
body = uc.render(txn, decomp);
} else if (u.path[2] == "export.jsonl") {