diff --git a/src/lib/AccountComponent.svelte b/src/lib/AccountComponent.svelte index 452eab5..61c6f0f 100644 --- a/src/lib/AccountComponent.svelte +++ b/src/lib/AccountComponent.svelte @@ -1,16 +1,20 @@ @@ -18,20 +22,31 @@
{#if account.avatarCid} - avatar of {account.displayName} + + {#if statusEmoji} + + {/if} + avatar of {account.displayName} +
{account.displayName || account.handle || account.did}
{:else} - unknown avatar of {account.displayName} + + {#if statusEmoji} + + {/if} + + unknown avatar of {account.displayName} +
{account.displayName || account.handle || account.did}
@@ -40,5 +55,6 @@
diff --git a/src/lib/pdsfetch.ts b/src/lib/pdsfetch.ts index ce662d2..a0232aa 100644 --- a/src/lib/pdsfetch.ts +++ b/src/lib/pdsfetch.ts @@ -407,6 +407,25 @@ const getTealNowListeningTo = async (did: At.Did) => { return null; } +type statusSphere = { + status: string; +} + +const getStatusSphere = async (did: At.Did) => { + const { data } = await rpc.get("com.atproto.repo.listRecords", { + params: { + repo: did as At.Identifier, + collection: "xyz.statusphere.status", + limit: 1 + }, + }); + if (data.records.length > 0) { + const record = data.records[0].value as statusSphere; + return record.status; + } + return null; +} + type CacheEntry = { data: T; expire_timestamp: number; @@ -448,5 +467,5 @@ const cacheGet = (key: string): T | null => { } } -export { getAllMetadataFromPds, getNextPosts, Post, blueskyHandleFromDid, getTealNowListeningTo }; +export { getAllMetadataFromPds, getNextPosts, Post, blueskyHandleFromDid, getTealNowListeningTo, getStatusSphere }; export type { AccountMetadata };