mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-10 07:31:27 -07:00
support for 202507 endpoints (#37)
* [auth][api] accept the 20250424.01 client * [2025] unstable * 20250718.0 * correct one this time * stubs * more stubs * more stubs * [lists] add worker * [ai] route stubs * [api] player photo setting * [econ] add roomEconConfig route * [infra] update worker generators * [worker] add cards/moderation/platformnotification workers * [lists] updates to some endpoints * [clubs] stub out announcement endpoint, for now * [econ] stub out season endpoints for now * [chat] apps/chat stub out party endpoint not sure the shape yet * [api] stub out statsig and lockeditems * [doc] new services * [lists] stub the bulk endpoint * [datacollection] add placeholder service until we can kill it * [api] set gifting to lvl5 * update lock * [cdn] enable cache * [match] matchmake v2 * [lists] stub some lists * [ai] stubs * [rooms] new subroom save endpoint * [econ] add bulk purchase endpoint * [discovery] update featured creator to 1 for fun * [api] add photo settings flag * [chat] fixup chat permissions (sorta) * [auth] restrictions endpoint * [rooms] contributed endpoint * [api] fix outfit endpoint * [discovery] attempt to fix store * [chat] privacy endpoints * [api] cheered images * [rooms] add xp endpoint (disbaled) * [rooms] add xp endpoint (disabled) * update images-db for cheers * [rooms] add autocomplete endpoint * [cdn/img] increase cache ttl for statics * [api] bulk route for images * [accounts] add banner image * [api] add misc missing endpoints * [discovery] remove AI tab * [platformnotifications] stub some endpoints * [lists] add some more lists * [rooms] additional endpoints * [chat] stub a few privacy endpoints * [econ] stub some endpoints * misc db fixes * [api] tweak shape for images v6 * [rooms] dont show trending RROs
This commit is contained in:
@@ -4,6 +4,7 @@ import { describeRoute } from 'hono-openapi'
|
||||
import {
|
||||
acceptFriendRequest,
|
||||
addFriend,
|
||||
countOnlineFriends,
|
||||
getAccountsByIds,
|
||||
getMutualFriendIds,
|
||||
getRelationshipsForPlayer,
|
||||
@@ -23,6 +24,7 @@ import {
|
||||
AUTHED,
|
||||
ErrorResponse,
|
||||
form,
|
||||
FriendOnlineCountResponse,
|
||||
intQuery,
|
||||
json,
|
||||
JsonArray,
|
||||
@@ -622,6 +624,37 @@ export const socialRoutes = new Hono<App>({ strict: false })
|
||||
}),
|
||||
(c) => c.json([])
|
||||
)
|
||||
// How many of the caller's friends are online — the friends panel's header count.
|
||||
// Answered from the friend graph joined to live presence, so it agrees with the
|
||||
// friends the panel then lists. Auth-gated: the count is the CALLER's own.
|
||||
.post(
|
||||
'/api/messages/v1/friendOnlineStatus',
|
||||
describeRoute({
|
||||
tags: ['Social'],
|
||||
summary: 'How many friends are online',
|
||||
description:
|
||||
'The caller’s `Friend` relationships joined to live `presence`. Only unexpired ' +
|
||||
'presence counts, and friends in the lobby (no room instance) count too — they ' +
|
||||
'are signed in, just not in a room.\n\n' +
|
||||
'A friend’s `statusVisibility` is not consulted: nothing else in the stack filters ' +
|
||||
'presence on it, so hiding people here would disagree with the list the client ' +
|
||||
'renders underneath the count.\n\n' +
|
||||
'A POST that takes no body — the player is the bearer token.',
|
||||
security: AUTHED,
|
||||
responses: {
|
||||
200: json(FriendOnlineCountResponse, 'The caller’s online-friend count'),
|
||||
401: UNAUTHORIZED_RESPONSE,
|
||||
},
|
||||
}),
|
||||
async (c) => {
|
||||
const id = await authedId(c)
|
||||
if (id === null) return unauthorized(c)
|
||||
return c.json({
|
||||
success: true,
|
||||
value: { FriendsOnlineCount: await countOnlineFriends(c.env.DB, id) },
|
||||
})
|
||||
}
|
||||
)
|
||||
.get(
|
||||
'/api/messages/v1/favoriteFriendOnlineStatus',
|
||||
describeRoute({
|
||||
|
||||
Reference in New Issue
Block a user