From 13b21b205de749f564d08b7c0ad8c20403dd9463 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 25 Sep 2019 16:11:18 +0100 Subject: [PATCH] only show non-replies with ,fedi --- modules/fediverse/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/fediverse/__init__.py b/modules/fediverse/__init__.py index c53f248c..a4c47d1d 100644 --- a/modules/fediverse/__init__.py +++ b/modules/fediverse/__init__.py @@ -77,12 +77,16 @@ class Module(ModuleManager.BaseModule): actor = ap_actor.Actor(actor_url) if not actor.load(): raise utils.EventError("Failed to find user") - items = actor.outbox.load() - if not items: + items = actor.outbox.load() + for item in items: + if item["object"]["inReplyTo"] == None: + first_item = item + + if not first_item: raise utils.EventError("No toots found") - cw, out, url = ap_utils.format_note(actor, items[0]) + cw, out, url = ap_utils.format_note(actor, first_item) shorturl = self.exports.get_one("shorturl")(event["server"], url, context=event["target"])