mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-23 02:48:17 +00:00
bugfixes
This commit is contained in:
@ -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;
|
||||
|
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user