This commit is contained in:
Doug Hoyte
2024-12-19 20:42:54 -05:00
parent c4bb4b3f4c
commit 55f637a2f0
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,8 @@
#pragma once
#include <algorithm>
#include <cctype>
#include "re2/re2.h"
#include "Bech32Utils.h"
@ -271,6 +274,9 @@ struct Event {
auto firstUrl = stripUrls(content);
preprocessEventContent(txn, decomp, userCache, content, false);
// If it was only a URL, just use raw URL
if (content.size() == 0 || std::all_of(content.begin(), content.end(), [](unsigned char c){ return std::isspace(c); })) content = firstUrl;
auto textAbbrev = [](std::string &str, size_t maxLen){
if (str.size() > maxLen) str = str.substr(0, maxLen-3) + "...";
};
@ -600,9 +606,11 @@ struct EventThread {
struct {
TemplarResult foundEvents;
std::vector<ReplyCtx> orphanNodes;
bool isFullThreadLoaded;
} ctx;
ctx.foundEvents = process(rootEventId);
ctx.isFullThreadLoaded = isFullThreadLoaded;
for (auto &[id, e] : eventCache) {
if (processedLevIds.contains(e.ev.primaryKeyId)) continue;

View File

@ -1,7 +1,7 @@
<div class="event-root">
$(ctx.foundEvents)
<div class="orphan-separator"> ?(ctx.orphanNodes.size() > 0)
<div class="orphan-separator"> ?(ctx.isFullThreadLoaded && ctx.orphanNodes.size() > 0)
<span>orphan notes (missing parents)</span>
</div>