show first toot if it's a boost, fix Note boost formatting

This commit is contained in:
jesopo 2019-10-15 15:13:28 +01:00
parent 205049ab6f
commit f739064d10
2 changed files with 4 additions and 2 deletions

View file

@ -111,7 +111,8 @@ class Module(ModuleManager.BaseModule):
items = actor.outbox.load()
for item in items:
if item["object"].get("inReplyTo", None) == None:
if (item["type"] == "Announce" or
item["object"].get("inReplyTo", None) == None):
first_item = item
break

View file

@ -1,6 +1,7 @@
import urllib.parse
import bs4
from src import IRCBot, utils
from . import ap_actor
LD_TYPE = ("application/ld+json; "
"profile=\"https://www.w3.org/ns/activitystreams\"")
@ -93,7 +94,7 @@ def format_note(actor, note, type="Create"):
retooted_user = "@%s@%s" % (original_tooter.username, retoot_instance)
retoot_content = _normalise_note(retoot.data["content"])
return (retoot.data.get("summary", None), "%s (boost %s): %s - %s" % (
return (retoot.data.get("summary", None), "%s (boost %s): %s" % (
actor.username, retooted_user, retoot_content), retoot_url)
elif type == "Create":