mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
terminal: commands to mute/unmute contacts and groups (#1018)
* terminal: commands to mute/unmute contacts and groups * tests
This commit is contained in:
committed by
GitHub
parent
f512298d10
commit
b232b6132f
@@ -609,9 +609,9 @@ toContactOrError ((contactId, profileId, localDisplayName, viaGroup, displayName
|
||||
|
||||
-- TODO return the last connection that is ready, not any last connection
|
||||
-- requires updating connection status
|
||||
getContactByName :: DB.Connection -> UserId -> ContactName -> ExceptT StoreError IO Contact
|
||||
getContactByName db userId localDisplayName = do
|
||||
cId <- getContactIdByName db userId localDisplayName
|
||||
getContactByName :: DB.Connection -> User -> ContactName -> ExceptT StoreError IO Contact
|
||||
getContactByName db user@User {userId} localDisplayName = do
|
||||
cId <- getContactIdByName db user localDisplayName
|
||||
getContact db userId cId
|
||||
|
||||
getUserContacts :: DB.Connection -> User -> IO [Contact]
|
||||
@@ -3012,8 +3012,8 @@ getDirectChatStats_ db userId contactId =
|
||||
toChatStats' [statsRow] = toChatStats statsRow
|
||||
toChatStats' _ = ChatStats {unreadCount = 0, minUnreadItemId = 0}
|
||||
|
||||
getContactIdByName :: DB.Connection -> UserId -> ContactName -> ExceptT StoreError IO Int64
|
||||
getContactIdByName db userId cName =
|
||||
getContactIdByName :: DB.Connection -> User -> ContactName -> ExceptT StoreError IO Int64
|
||||
getContactIdByName db User {userId} cName =
|
||||
ExceptT . firstRow fromOnly (SEContactNotFoundByName cName) $
|
||||
DB.query db "SELECT contact_id FROM contacts WHERE user_id = ? AND local_display_name = ?" (userId, cName)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user