@rmdes/indiekit-endpoint-activitypub 2.9.0 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/assets/reader.css
CHANGED
|
@@ -1374,6 +1374,7 @@
|
|
|
1374
1374
|
|
|
1375
1375
|
.ap-messages__partner--active {
|
|
1376
1376
|
background: var(--color-offset);
|
|
1377
|
+
border-left: 3px solid var(--color-primary);
|
|
1377
1378
|
font-weight: var(--font-weight-bold);
|
|
1378
1379
|
}
|
|
1379
1380
|
|
|
@@ -1388,12 +1389,15 @@
|
|
|
1388
1389
|
border-radius: 50%;
|
|
1389
1390
|
height: 100%;
|
|
1390
1391
|
object-fit: cover;
|
|
1392
|
+
position: absolute;
|
|
1393
|
+
inset: 0;
|
|
1391
1394
|
width: 100%;
|
|
1395
|
+
z-index: 1;
|
|
1392
1396
|
}
|
|
1393
1397
|
|
|
1394
1398
|
.ap-messages__partner-initial {
|
|
1395
1399
|
align-items: center;
|
|
1396
|
-
background: var(--color-offset);
|
|
1400
|
+
background: var(--color-offset-variant);
|
|
1397
1401
|
border-radius: 50%;
|
|
1398
1402
|
color: var(--color-on-offset);
|
|
1399
1403
|
display: flex;
|
|
@@ -1403,10 +1407,6 @@
|
|
|
1403
1407
|
width: 100%;
|
|
1404
1408
|
}
|
|
1405
1409
|
|
|
1406
|
-
.ap-messages__partner-avatar img + .ap-messages__partner-initial {
|
|
1407
|
-
display: none;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
1410
|
.ap-messages__partner-info {
|
|
1411
1411
|
display: flex;
|
|
1412
1412
|
flex-direction: column;
|
|
@@ -1434,7 +1434,11 @@
|
|
|
1434
1434
|
}
|
|
1435
1435
|
|
|
1436
1436
|
.ap-message--outbound {
|
|
1437
|
-
border-left
|
|
1437
|
+
border-left: 3px solid var(--color-primary);
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
.ap-message .ap-notification__time {
|
|
1441
|
+
padding-right: var(--space-l);
|
|
1438
1442
|
}
|
|
1439
1443
|
|
|
1440
1444
|
.ap-message__direction {
|
|
@@ -1458,6 +1462,17 @@
|
|
|
1458
1462
|
margin-bottom: 0;
|
|
1459
1463
|
}
|
|
1460
1464
|
|
|
1465
|
+
/* Inline mention links in DM content (Mastodon wraps @user in span inside a link) */
|
|
1466
|
+
.ap-message__content .h-card,
|
|
1467
|
+
.ap-message__content a.mention,
|
|
1468
|
+
.ap-message__content a span {
|
|
1469
|
+
display: inline;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.ap-message__content a {
|
|
1473
|
+
overflow-wrap: break-word;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1461
1476
|
@media (max-width: 640px) {
|
|
1462
1477
|
.ap-messages__layout {
|
|
1463
1478
|
grid-template-columns: 1fr;
|
|
@@ -37,11 +37,13 @@ export function messagesController(mountPath) {
|
|
|
37
37
|
options.partner = partner;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
// Get messages + conversation partners + unread count in parallel
|
|
41
|
-
const
|
|
40
|
+
// Get messages + conversation partners + unread count + our profile in parallel
|
|
41
|
+
const profileCol = application?.collections?.get("ap_profile");
|
|
42
|
+
const [result, partners, unreadCount, myProfile] = await Promise.all([
|
|
42
43
|
getMessages(collections, options),
|
|
43
44
|
getConversationPartners(collections),
|
|
44
45
|
getUnreadMessageCount(collections),
|
|
46
|
+
profileCol ? profileCol.findOne({}) : null,
|
|
45
47
|
]);
|
|
46
48
|
|
|
47
49
|
// Auto mark-read when viewing a specific conversation
|
|
@@ -59,6 +61,7 @@ export function messagesController(mountPath) {
|
|
|
59
61
|
partners,
|
|
60
62
|
activePartner: partner,
|
|
61
63
|
unreadCount,
|
|
64
|
+
myProfile,
|
|
62
65
|
csrfToken,
|
|
63
66
|
mountPath,
|
|
64
67
|
});
|
|
@@ -259,7 +262,7 @@ export function submitMessageController(mountPath, plugin) {
|
|
|
259
262
|
uid: noteId,
|
|
260
263
|
actorUrl: recipient.id.href,
|
|
261
264
|
actorName: recipientName,
|
|
262
|
-
actorPhoto: recipient.iconUrl?.href || "",
|
|
265
|
+
actorPhoto: recipient.iconUrl?.href || recipient.icon?.url?.href || "",
|
|
263
266
|
actorHandle: recipientHandle,
|
|
264
267
|
content: {
|
|
265
268
|
text: content.trim(),
|
package/lib/storage/messages.js
CHANGED
|
@@ -101,12 +101,13 @@ export async function getConversationPartners(collections) {
|
|
|
101
101
|
const { ap_messages } = collections;
|
|
102
102
|
|
|
103
103
|
const pipeline = [
|
|
104
|
+
{ $sort: { published: -1 } },
|
|
104
105
|
{
|
|
105
106
|
$group: {
|
|
106
107
|
_id: "$conversationId",
|
|
107
|
-
actorName: { $
|
|
108
|
-
actorPhoto: { $
|
|
109
|
-
actorHandle: { $
|
|
108
|
+
actorName: { $first: "$actorName" },
|
|
109
|
+
actorPhoto: { $max: "$actorPhoto" },
|
|
110
|
+
actorHandle: { $first: "$actorHandle" },
|
|
110
111
|
lastMessage: { $max: "$published" },
|
|
111
112
|
unreadCount: {
|
|
112
113
|
$sum: { $cond: [{ $eq: ["$read", false] }, 1, 0] },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indiekit",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{# Message card partial — inbound/outbound DM display #}
|
|
2
2
|
|
|
3
|
-
<div class="ap-notification{% if not item.read %} ap-notification--unread{% endif %}{% if item.direction == 'outbound' %} ap-message--outbound{% endif %}">
|
|
3
|
+
<div class="ap-notification ap-message{% if not item.read %} ap-notification--unread{% endif %}{% if item.direction == 'outbound' %} ap-message--outbound{% endif %}">
|
|
4
4
|
{# Dismiss button #}
|
|
5
5
|
<form method="post" action="{{ mountPath }}/admin/reader/messages/delete" class="ap-notification__dismiss">
|
|
6
6
|
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
|
|
@@ -8,12 +8,17 @@
|
|
|
8
8
|
<button type="submit" class="ap-notification__dismiss-btn" title="{{ __('activitypub.messages.delete') }}">×</button>
|
|
9
9
|
</form>
|
|
10
10
|
|
|
11
|
-
{#
|
|
11
|
+
{# Avatar — outbound: our profile photo, inbound: sender's photo #}
|
|
12
12
|
<div class="ap-notification__avatar-wrap" data-avatar-fallback>
|
|
13
|
-
{% if item.
|
|
14
|
-
|
|
13
|
+
{% if item.direction == "outbound" and myProfile and myProfile.icon %}
|
|
14
|
+
<img src="{{ myProfile.icon }}" alt="{{ myProfile.name or 'Me' }}" class="ap-notification__avatar" loading="lazy" crossorigin="anonymous">
|
|
15
|
+
<span class="ap-notification__avatar ap-notification__avatar--default" aria-hidden="true">{{ (myProfile.name or "M")[0] | upper }}</span>
|
|
16
|
+
{% else %}
|
|
17
|
+
{% if item.actorPhoto %}
|
|
18
|
+
<img src="{{ item.actorPhoto }}" alt="{{ item.actorName }}" class="ap-notification__avatar" loading="lazy" crossorigin="anonymous">
|
|
19
|
+
{% endif %}
|
|
20
|
+
<span class="ap-notification__avatar ap-notification__avatar--default" aria-hidden="true">{{ item.actorName[0] | upper if item.actorName else "?" }}</span>
|
|
15
21
|
{% endif %}
|
|
16
|
-
<span class="ap-notification__avatar ap-notification__avatar--default" aria-hidden="true">{{ item.actorName[0] | upper if item.actorName else "?" }}</span>
|
|
17
22
|
<span class="ap-notification__type-badge">
|
|
18
23
|
{% if item.direction == "outbound" %}↗{% else %}✉{% endif %}
|
|
19
24
|
</span>
|