damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README | LICENSE

commit bb27b1c339384ec266cf89a046d33d00d37fd8e2
parent f773ab49f67838f0bea73a6852fed2c520836d56
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 17 Nov 2022 16:36:42 -0800

web: don't copy tags when replying

otherwise this crazy stuff happens:

https://nostr.com/e/da28aefc824cc7880e79df547cbe7f1e9d21e2ab81a264e311280d11b427ce05

Diffstat:
Mweb/index.html | 2+-
Mweb/js/damus.js | 7+++++--
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/web/index.html b/web/index.html @@ -12,7 +12,7 @@ <script defer src="js/noble-secp256k1.js?v=1"></script> <script defer src="js/bech32.js?v=1"></script> <script defer src="js/nostr.js?v=6"></script> - <script defer src="js/damus.js?v=86"></script> + <script defer src="js/damus.js?v=87"></script> </head> <body> <script> diff --git a/web/js/damus.js b/web/js/damus.js @@ -1078,9 +1078,12 @@ function gather_reply_tags(pubkey, from) { for (const tag of from.tags) { if (tag.length >= 2) { if (tag[0] === "e") { - tags.push(tag) + if (tag.length >= 4 && tag[3] == "root") + tags.push(tag) + else + tags.push(["e", tag[1]]) } else if (tag[0] === "p" && tag[1] !== pubkey) { - tags.push(tag) + tags.push(["p", tag[1]]) } } }