From 34a8ec100186f3b4f1764662f0a5bcb1bf432b91 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 30 Apr 2024 21:39:03 -0500 Subject: [PATCH] More clip-cloppy --- package.json | 1 + src/screens/Messages/Temp/query/query.ts | 25 ++++++++++++++++++++++++ yarn.lock | 12 ++++++++++++ 3 files changed, 38 insertions(+) diff --git a/package.json b/package.json index acb9007b45..28386fc47d 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "open-analyzer": "EXPO_PUBLIC_OPEN_ANALYZER=1 yarn build-web" }, "dependencies": { + "@atproto-labs/api": "^0.12.8-clipclops.0", "@atproto/api": "^0.12.5", "@bam.tech/react-native-image-resizer": "^3.0.4", "@braintree/sanitize-url": "^6.0.2", diff --git a/src/screens/Messages/Temp/query/query.ts b/src/screens/Messages/Temp/query/query.ts index a4d78e0bb7..e53cdfb9b1 100644 --- a/src/screens/Messages/Temp/query/query.ts +++ b/src/screens/Messages/Temp/query/query.ts @@ -1,3 +1,4 @@ +import {BskyAgent} from '@atproto-labs/api' import { useInfiniteQuery, useMutation, @@ -299,3 +300,27 @@ export function useChatQuery(chatId: string) { }, }) } + +export function useConvoQuery(convoId: string) { + const headers = useHeaders() + const {serviceUrl} = useDmServiceUrlStorage() + + return useQuery({ + queryKey: ['convoQuery', convoId], + queryFn: async () => { + const agent = new BskyAgent({ + service: serviceUrl, + }) + const {data} = await agent.api.chat.bsky.convo.getConvo( + { + convoId, + }, + { + headers, + }, + ) + + return data.convo + }, + }) +} diff --git a/yarn.lock b/yarn.lock index 5d62929d47..8c014e28ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,6 +34,18 @@ jsonpointer "^5.0.0" leven "^3.1.0" +"@atproto-labs/api@^0.12.8-clipclops.0": + version "0.12.8-clipclops.0" + resolved "https://registry.yarnpkg.com/@atproto-labs/api/-/api-0.12.8-clipclops.0.tgz#1c5d41d3396e439a0b645f7e1ccf500cc4b42580" + integrity sha512-YYDtWWk6BR+aRBVja/1v+gceNK81lkmF5bi6O4pTmJhFt/321XATx/ql8uTWta4VnVThoFeNPG6nLr7hs8b9cA== + dependencies: + "@atproto/common-web" "^0.3.0" + "@atproto/lexicon" "^0.4.0" + "@atproto/syntax" "^0.3.0" + "@atproto/xrpc" "^0.5.0" + multiformats "^9.9.0" + tlds "^1.234.0" + "@atproto/api@^0.12.3": version "0.12.3" resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.12.3.tgz#5b7b1c7d4210ee9315961504900c8409395cbb17"