web: don't copy tags when replying

otherwise this crazy stuff happens:

https://nostr.com/e/da28aefc824cc7880e79df547cbe7f1e9d21e2ab81a264e311280d11b427ce05
This commit is contained in:
William Casarin 2022-11-17 16:36:42 -08:00
parent f773ab49f6
commit bb27b1c339
2 changed files with 6 additions and 3 deletions

View file

@ -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>

View file

@ -1078,9 +1078,12 @@ function gather_reply_tags(pubkey, from) {
for (const tag of from.tags) {
if (tag.length >= 2) {
if (tag[0] === "e") {
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]])
}
}
}