+1
-11
packages/appview/src/api/lexicons/getStatuses.ts
+1
-11
packages/appview/src/api/lexicons/getStatuses.ts
···
1
-
import { XyzStatusphereStatus } from '@statusphere/lexicon'
2
-
3
import { AppContext } from '#/context'
4
import { Server } from '#/lexicons'
5
import { statusToStatusView } from '#/lib/hydrate'
···
19
encoding: 'application/json',
20
body: {
21
statuses: await Promise.all(
22
-
statuses
23
-
.filter(
24
-
(status) =>
25
-
XyzStatusphereStatus.validateRecord({
26
-
$type: 'xyz.statusphere.status',
27
-
...status,
28
-
}).success,
29
-
)
30
-
.map((status) => statusToStatusView(status, ctx)),
31
),
32
},
33
}
+4
packages/appview/src/lib/hydrate.ts
+4
packages/appview/src/lib/hydrate.ts
···
1
+
import assert from 'node:assert'
2
import {
3
AppBskyActorDefs,
4
AppBskyActorProfile,
···
20
did: status.authorDid,
21
handle: await ctx.resolver
22
.resolveDidToHandle(status.authorDid)
23
+
.then((handle) =>
24
+
handle.startsWith('did:') ? 'invalid.handle' : handle,
25
+
)
26
.catch(() => 'invalid.handle'),
27
},
28
}