+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
1
import { AppContext } from '#/context'
4
2
import { Server } from '#/lexicons'
5
3
import { statusToStatusView } from '#/lib/hydrate'
···
19
17
encoding: 'application/json',
20
18
body: {
21
19
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)),
20
+
statuses.map((status) => statusToStatusView(status, ctx)),
31
21
),
32
22
},
33
23
}
+4
packages/appview/src/lib/hydrate.ts
+4
packages/appview/src/lib/hydrate.ts
···
1
+
import assert from 'node:assert'
1
2
import {
2
3
AppBskyActorDefs,
3
4
AppBskyActorProfile,
···
19
20
did: status.authorDid,
20
21
handle: await ctx.resolver
21
22
.resolveDidToHandle(status.authorDid)
23
+
.then((handle) =>
24
+
handle.startsWith('did:') ? 'invalid.handle' : handle,
25
+
)
22
26
.catch(() => 'invalid.handle'),
23
27
},
24
28
}