core: api to remove profile image (#448)

This commit is contained in:
Evgeny Poberezkin
2022-03-19 07:42:54 +00:00
committed by GitHub
parent 0e73697ea4
commit 3340bea150
3 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -436,7 +436,7 @@ processChatCommand = \case
let p = (profile :: Profile) {displayName = displayName, fullName = fullName}
updateProfile user p
UpdateProfileImage image -> withUser $ \user@User {profile} -> do
let p = (profile :: Profile) {image = Just image}
let p = (profile :: Profile) {image}
updateProfile user p
QuitChat -> liftIO exitSuccess
ShowVersion -> pure $ CRVersionInfo versionNumber
@@ -1559,7 +1559,8 @@ chatCommandP =
<|> ("/reject @" <|> "/reject " <|> "/rc @" <|> "/rc ") *> (RejectContact <$> displayName)
<|> ("/markdown" <|> "/m") $> ChatHelp HSMarkdown
<|> ("/welcome" <|> "/w") $> Welcome
<|> "/profile_image " *> (UpdateProfileImage . ProfileImage <$> imageP)
<|> "/profile_image " *> (UpdateProfileImage . Just . ProfileImage <$> imageP)
<|> "/profile_image" $> UpdateProfileImage Nothing
<|> ("/profile " <|> "/p ") *> (uncurry UpdateProfile <$> userNames)
<|> ("/profile" <|> "/p") $> ShowProfile
<|> ("/quit" <|> "/q" <|> "/exit") $> QuitChat
+1 -1
View File
@@ -131,7 +131,7 @@ data ChatCommand
| FileStatus FileTransferId
| ShowProfile
| UpdateProfile ContactName Text
| UpdateProfileImage ProfileImage
| UpdateProfileImage (Maybe ProfileImage)
| QuitChat
| ShowVersion
deriving (Show)