feat: add Direct Messages tab to reader view
This commit is contained in:
@@ -47,6 +47,31 @@ export function readerController(mountPath) {
|
|||||||
// Unread filter
|
// Unread filter
|
||||||
const unread = request.query.unread === "1";
|
const unread = request.query.unread === "1";
|
||||||
|
|
||||||
|
// Direct messages tab — conversation view
|
||||||
|
if (tab === "direct") {
|
||||||
|
const csrfToken = getToken(request.session);
|
||||||
|
const [conversations, unreadCount] = await Promise.all([
|
||||||
|
getDirectConversations(collections),
|
||||||
|
getUnreadNotificationCount(collections),
|
||||||
|
]);
|
||||||
|
return response.render("activitypub-reader", {
|
||||||
|
title: response.locals.__("activitypub.reader.title"),
|
||||||
|
readerParent: { href: mountPath, text: response.locals.__("activitypub.title") },
|
||||||
|
conversations,
|
||||||
|
items: [],
|
||||||
|
tab,
|
||||||
|
unread: false,
|
||||||
|
before: null,
|
||||||
|
after: null,
|
||||||
|
unreadCount,
|
||||||
|
unreadTimelineCount: 0,
|
||||||
|
interactionMap: {},
|
||||||
|
csrfToken,
|
||||||
|
mountPath,
|
||||||
|
followedTags: [],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Build query options
|
// Build query options
|
||||||
const options = { before, after, limit, unread };
|
const options = { before, after, limit, unread };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user