aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-15 15:13:28 +0100
committerGravatar jesopo2019-10-15 15:13:28 +0100
commitf739064d10bc6f682d47683c95a95cc1c13fceb4 (patch)
treed74d73814e42ec9125d347bcbf43001f8cc4f1c3 /modules
parentremove unused util functions in git_webhooks/gitea.py (diff)
signature
show `first` toot if it's a boost, fix Note boost formatting
Diffstat (limited to 'modules')
-rw-r--r--modules/fediverse/__init__.py3
-rw-r--r--modules/fediverse/ap_utils.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/fediverse/__init__.py b/modules/fediverse/__init__.py
index bbf29110..575f0f6a 100644
--- a/modules/fediverse/__init__.py
+++ b/modules/fediverse/__init__.py
@@ -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
diff --git a/modules/fediverse/ap_utils.py b/modules/fediverse/ap_utils.py
index 10aa0a67..e8f25bbc 100644
--- a/modules/fediverse/ap_utils.py
+++ b/modules/fediverse/ap_utils.py
@@ -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":