[Chat] Moderation stuff (#10610)
This commit is contained in:
Vendored
+2
@@ -10,6 +10,7 @@ import {findAllProfilesInQueryData as findAllProfilesInExploreFeedPreviewsQueryD
|
||||
import {findAllProfilesInQueryData as findAllProfilesInContactMatchesQueryData} from '#/state/queries/find-contacts'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInKnownFollowersQueryData} from '#/state/queries/known-followers'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInListMembersQueryData} from '#/state/queries/list-members'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInGetConvoQueryData} from '#/state/queries/messages/conversation'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInListConvosQueryData} from '#/state/queries/messages/list-conversations'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInMessagesQueryData} from '#/state/queries/messages/list-convo-members'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInMyBlockedAccountsQueryData} from '#/state/queries/my-blocked-accounts'
|
||||
@@ -266,4 +267,5 @@ function* findProfilesInCache(
|
||||
yield* findAllProfilesInNotifsQueryData(queryClient, did)
|
||||
yield* findAllProfilesInContactMatchesQueryData(queryClient, did)
|
||||
yield* findAllProfilesInMessagesQueryData(queryClient, did)
|
||||
yield* findAllProfilesInGetConvoQueryData(queryClient, did)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import {type ChatBskyConvoDefs} from '@atproto/api'
|
||||
import {
|
||||
type ChatBskyActorDefs,
|
||||
type ChatBskyConvoDefs,
|
||||
type ChatBskyConvoGetConvo,
|
||||
} from '@atproto/api'
|
||||
import {
|
||||
type QueryClient,
|
||||
useMutation,
|
||||
@@ -109,3 +113,22 @@ export function useMarkAsReadMutation() {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export function* findAllProfilesInQueryData(
|
||||
queryClient: QueryClient,
|
||||
did: string,
|
||||
): Generator<ChatBskyActorDefs.ProfileViewBasic, void> {
|
||||
const queryDatas = queryClient.getQueriesData<
|
||||
ChatBskyConvoGetConvo.OutputSchema['convo']
|
||||
>({
|
||||
queryKey: [RQKEY_ROOT],
|
||||
})
|
||||
for (const [_queryKey, queryData] of queryDatas) {
|
||||
if (!queryData) continue
|
||||
for (const member of queryData.members) {
|
||||
if (member.did === did) {
|
||||
yield member
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user