Untagged mentions fix

This commit is contained in:
Kieran 2023-01-06 15:48:10 +00:00
parent c1941754e4
commit 86cfc4c4e3
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -31,12 +31,14 @@ export default class Thread {
if (!marked) {
ret.Root = eTags[0];
ret.Root.Marker = "root";
if (eTags.length > 1) {
ret.ReplyTo = eTags[1];
ret.ReplyTo.Marker = "reply";
}
if (eTags.length > 2) {
ret.Mentions = eTags.slice(1, -1);
ret.Mentions = eTags.slice(2);
ret.Mentions.forEach(a => a.Marker = "mention");
}
ret.ReplyTo = eTags[eTags.length - 1];
ret.ReplyTo.Marker = "reply";
} else {
let root = eTags.find(a => a.Marker === "root");
let reply = eTags.find(a => a.Marker === "reply");