mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core: invalid name error when it matches hidden profile (#3647)
This commit is contained in:
committed by
GitHub
parent
8882284fb7
commit
0ef2c55983
+3
-2
@@ -454,8 +454,9 @@ processChatCommand' vr = \case
|
||||
withStore' getUsers >>= \case
|
||||
[] -> pure 1
|
||||
users -> do
|
||||
when (any (\User {localDisplayName = n} -> n == displayName) users) $
|
||||
throwChatError (CEUserExists displayName)
|
||||
forM_ users $ \User {localDisplayName = n, activeUser, viewPwdHash} ->
|
||||
when (n == displayName) . throwChatError $
|
||||
if activeUser || isNothing viewPwdHash then CEUserExists displayName else CEInvalidDisplayName {displayName, validName = ""}
|
||||
withAgent (\a -> createUser a smp xftp)
|
||||
ts <- liftIO $ getCurrentTime >>= if pastTimestamp then coupleDaysAgo else pure
|
||||
user <- withStore $ \db -> createUserRecordAt db (AgentUserId auId) p True ts
|
||||
|
||||
Reference in New Issue
Block a user