New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: api to differentiate contacts and conversations #4111
Conversation
@@ -1009,22 +1009,41 @@ processChatCommand' vr = \case | |||
liftIO $ updateNoteFolderUnreadChat db user nf unreadChat | |||
ok user | |||
_ -> pure $ chatCmdError (Just user) "not supported" | |||
APIDeleteChat (ChatRef cType chatId) notify -> withUser $ \user@User {userId} -> case cType of | |||
APIDeleteChat cRef@(ChatRef cType chatId) chatDeleteMode -> withUser $ \user@User {userId} -> case cType of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for CDMEntity and CDMMessages UI would differentiate on response based on call params - update in model instead of deleting
@@ -315,7 +315,7 @@ updateChatTs db User {userId} chatDirection chatTs = case toChatInfo chatDirecti | |||
DirectChat Contact {contactId} -> | |||
DB.execute | |||
db | |||
"UPDATE contacts SET chat_ts = ? WHERE user_id = ? AND contact_id = ?" | |||
"UPDATE contacts SET chat_ts = ?, chat_deleted = 0 WHERE user_id = ? AND contact_id = ?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on new chat items UI would "manually" update contacts with chatDeleted set to False. May be a bit hacky but it seems a normal assumption to do from UI view point and less hassle than correctly propagate contact update from db operations to all responses in backend. This is somewhat similar in logic to chat "popping" to top on new chat items being only UI logic
No description provided.