commit a190a5e8fb2f762d3ed70b371f0f40c8e5c7b0ae
parent 514a053dce3b86ebf53817a97ef5543127ffab45
Author: William Casarin <jb55@jb55.com>
Date: Thu, 9 May 2024 13:49:06 -0700
nip10: handle invalid reply-with-no-root
I noticed a few clients do this even though its not valid. Let's handle it.
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/damus/NIP10/ThreadReply.swift b/damus/NIP10/ThreadReply.swift
@@ -48,6 +48,11 @@ struct ThreadReply {
}
}
+ // reply with no root should be considered reply-to-root
+ if root == nil && reply != nil {
+ root = reply
+ }
+
// nip10 threads must have a root
guard let root else {
return nil