From 538ca8dff16e9973a0fd4c310dd89cfe05536f6b Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Wed, 1 May 2024 12:14:41 -0500
Subject: [Clipclops] 2 Clipped 2 Clopped (#3796)

* Add new pkg

* copy queries over to new file

* useConvoQuery

* useListConvos

* Use useListConvos

* extract useConvoQuery

* useGetConvoForMembers

* Delete unused

* exract useListConvos

* Replace imports

* Messages/List/index.tsx

* extract getconvoformembers

* MessageItem

* delete chatLog and rename query.ts

* Update import

* Clipclop service (#3794)

* Add Chat service

* Better handle deletions

* Rollback unneeded changes

* Better insertion order

* Use clipclops

* don't show FAB if error

* clean up imports

* Update Convo service

* Remove temp files

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
---
 src/screens/Messages/Conversation/MessageItem.tsx | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'src/screens/Messages/Conversation/MessageItem.tsx')

diff --git a/src/screens/Messages/Conversation/MessageItem.tsx b/src/screens/Messages/Conversation/MessageItem.tsx
index 85e1c5f32..ba10978e8 100644
--- a/src/screens/Messages/Conversation/MessageItem.tsx
+++ b/src/screens/Messages/Conversation/MessageItem.tsx
@@ -1,5 +1,6 @@
 import React, {useCallback, useMemo} from 'react'
 import {StyleProp, TextStyle, View} from 'react-native'
+import {ChatBskyConvoDefs} from '@atproto-labs/api'
 import {msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 
@@ -7,14 +8,16 @@ import {useSession} from '#/state/session'
 import {TimeElapsed} from '#/view/com/util/TimeElapsed'
 import {atoms as a, useTheme} from '#/alf'
 import {Text} from '#/components/Typography'
-import * as TempDmChatDefs from '#/temp/dm/defs'
 
 export function MessageItem({
   item,
   next,
 }: {
-  item: TempDmChatDefs.MessageView
-  next: TempDmChatDefs.MessageView | TempDmChatDefs.DeletedMessage | null
+  item: ChatBskyConvoDefs.MessageView
+  next:
+    | ChatBskyConvoDefs.MessageView
+    | ChatBskyConvoDefs.DeletedMessageView
+    | null
 }) {
   const t = useTheme()
   const {currentAccount} = useSession()
@@ -22,7 +25,7 @@ export function MessageItem({
   const isFromSelf = item.sender?.did === currentAccount?.did
 
   const isNextFromSelf =
-    TempDmChatDefs.isMessageView(next) &&
+    ChatBskyConvoDefs.isMessageView(next) &&
     next.sender?.did === currentAccount?.did
 
   const isLastInGroup = useMemo(() => {
@@ -32,7 +35,7 @@ export function MessageItem({
     }
 
     // or, if there's a 10 minute gap between this message and the next
-    if (TempDmChatDefs.isMessageView(next)) {
+    if (ChatBskyConvoDefs.isMessageView(next)) {
       const thisDate = new Date(item.sentAt)
       const nextDate = new Date(next.sentAt)
 
@@ -88,7 +91,7 @@ function Metadata({
   isLastInGroup,
   style,
 }: {
-  message: TempDmChatDefs.MessageView
+  message: ChatBskyConvoDefs.MessageView
   isLastInGroup: boolean
   style: StyleProp<TextStyle>
 }) {
-- 
cgit 1.4.1

