show ,fedi latest-tweet also if it's a self-reply

This commit is contained in:
jesopo 2019-10-15 15:24:57 +01:00
parent f739064d10
commit 3f4eebf85b
2 changed files with 4 additions and 2 deletions

View file

@ -110,9 +110,9 @@ class Module(ModuleManager.BaseModule):
raise utils.EventError("Failed to find user") raise utils.EventError("Failed to find user")
items = actor.outbox.load() items = actor.outbox.load()
nonreply = [actor.followers]
for item in items: for item in items:
if (item["type"] == "Announce" or if item["type"] == "Announce" or item["object"]["cc"] == nonreply:
item["object"].get("inReplyTo", None) == None):
first_item = item first_item = item
break break

View file

@ -9,6 +9,7 @@ class Actor(object):
self.username = None self.username = None
self.inbox = None self.inbox = None
self.outbox = None self.outbox = None
self.followers = None
def load(self): def load(self):
response = ap_utils.activity_request(self.url) response = ap_utils.activity_request(self.url)
@ -16,6 +17,7 @@ class Actor(object):
self.username = response.data["preferredUsername"] self.username = response.data["preferredUsername"]
self.inbox = Inbox(response.data["inbox"]) self.inbox = Inbox(response.data["inbox"])
self.outbox = Outbox(response.data["outbox"]) self.outbox = Outbox(response.data["outbox"])
self.followers = response.data["followers"]
return True return True
return False return False