show first
toot if it's a boost, fix Note boost formatting
This commit is contained in:
parent
205049ab6f
commit
f739064d10
2 changed files with 4 additions and 2 deletions
|
@ -111,7 +111,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
items = actor.outbox.load()
|
items = actor.outbox.load()
|
||||||
for item in items:
|
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
|
first_item = item
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import bs4
|
import bs4
|
||||||
from src import IRCBot, utils
|
from src import IRCBot, utils
|
||||||
|
from . import ap_actor
|
||||||
|
|
||||||
LD_TYPE = ("application/ld+json; "
|
LD_TYPE = ("application/ld+json; "
|
||||||
"profile=\"https://www.w3.org/ns/activitystreams\"")
|
"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)
|
retooted_user = "@%s@%s" % (original_tooter.username, retoot_instance)
|
||||||
retoot_content = _normalise_note(retoot.data["content"])
|
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)
|
actor.username, retooted_user, retoot_content), retoot_url)
|
||||||
|
|
||||||
elif type == "Create":
|
elif type == "Create":
|
||||||
|
|
Loading…
Reference in a new issue