From b6991ce3e50a81ff64342b609af705d1728fb4dc Mon Sep 17 00:00:00 2001 From: ekzyis Date: Wed, 16 Oct 2024 19:51:55 +0200 Subject: [PATCH] Ignore nested replies --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 63b45e0..9cd5515 100644 --- a/main.go +++ b/main.go @@ -107,6 +107,14 @@ func tickGameProgress(c *sn.Client) { continue } + if parent, err := c.Item(n.Item.ParentId); err != nil { + log.Printf("failed to fetch parent %d of %d\n", n.Item.ParentId, n.Item.Id) + continue + } else if parent.User.Id != meId { + log.Printf("ignoring nested reply %d\n", n.Item.Id) + continue + } + if err = handleGameProgress(&n.Item); err != nil { if err.Error() == "failed to parse game update" {