Fix mention parsing

This commit is contained in:
Kieran 2022-12-29 16:19:16 +00:00
parent 5d5e6d986d
commit 8aaa5103c4
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 2 additions and 0 deletions

View File

@ -93,6 +93,7 @@ export default class Connection {
AddSubscription(sub) { AddSubscription(sub) {
let subObj = sub.ToObject(); let subObj = sub.ToObject();
if (Object.keys(subObj).length === 0) { if (Object.keys(subObj).length === 0) {
debugger;
throw "CANNOT SEND EMPTY SUB - FIX ME"; throw "CANNOT SEND EMPTY SUB - FIX ME";
} }
let req = ["REQ", sub.Id, subObj]; let req = ["REQ", sub.Id, subObj];

View File

@ -39,6 +39,7 @@ export default class Thread {
let reply = eTags.find(a => a.Marker === "reply"); let reply = eTags.find(a => a.Marker === "reply");
ret.Root = root; ret.Root = root;
ret.ReplyTo = reply; ret.ReplyTo = reply;
ret.Mentions = eTags.filter(a => a.Marker === "mention");
} }
ret.PubKeys = ev.Tags.filter(a => a.Key === "p").map(a => a.PubKey); ret.PubKeys = ev.Tags.filter(a => a.Key === "p").map(a => a.PubKey);