diff --git a/sat/plugins/plugin_comp_ap_gateway/__init__.py b/sat/plugins/plugin_comp_ap_gateway/__init__.py index fa0e1b2f..d77f046e 100644 --- a/sat/plugins/plugin_comp_ap_gateway/__init__.py +++ b/sat/plugins/plugin_comp_ap_gateway/__init__.py @@ -2225,7 +2225,16 @@ class APGateway: mb_data["id"] = origin_id client = self.client.getVirtualClient(mess_data["from"]) ap_item = await self.mb_data_2_ap_item(client, mb_data, public=False) - ap_item["object"]["to"] = ap_item["to"] = [actor_id] + ap_object = ap_item["object"] + ap_object["to"] = ap_item["to"] = [actor_id] + # we add a mention to direct message, otherwise peer is not notified in some AP + # implementations (notably Mastodon), and the message may be missed easily. + ap_object.setdefault("tag", []).append({ + "type": TYPE_MENTION, + "href": actor_id, + "name": f"@{actor_account}", + }) + await self.signAndPost(inbox, ap_item["actor"], ap_item) return mess_data