core: add set display name (#3216)

* core: add set display name

* enable all tests
This commit is contained in:
Evgeny Poberezkin
2023-10-14 13:10:06 +01:00
committed by GitHub
parent 5e6aaffb09
commit f5e9bd4f8b
6 changed files with 57 additions and 51 deletions
+8 -4
View File
@@ -179,6 +179,7 @@ data ChatController = ChatController
sndFiles :: TVar (Map Int64 Handle),
rcvFiles :: TVar (Map Int64 Handle),
currentCalls :: TMap ContactId Call,
localDeviceName :: TVar Text,
remoteHostSessions :: TMap RemoteHostId RemoteHostSession, -- All the active remote hosts
remoteCtrlSession :: TVar (Maybe RemoteCtrlSession), -- Supervisor process for hosted controllers
config :: ChatConfig,
@@ -419,6 +420,7 @@ data ChatCommand
| SetUserTimedMessages Bool -- UserId (not used in UI)
| SetContactTimedMessages ContactName (Maybe TimedMessagesEnabled)
| SetGroupTimedMessages GroupName (Maybe Int)
| SetLocalDeviceName Text
| CreateRemoteHost -- ^ Configure a new remote host
| ListRemoteHosts
| StartRemoteHost RemoteHostId -- ^ Start and announce a remote host
@@ -629,9 +631,9 @@ data ChatResponse
| CRNtfMessages {user_ :: Maybe User, connEntity :: Maybe ConnectionEntity, msgTs :: Maybe UTCTime, ntfMessages :: [NtfMsgInfo]}
| CRNewContactConnection {user :: User, connection :: PendingContactConnection}
| CRContactConnectionDeleted {user :: User, connection :: PendingContactConnection}
| CRRemoteHostCreated {remoteHostId :: RemoteHostId, oobData :: RemoteCtrlOOB}
| CRRemoteHostList {remoteHosts :: [RemoteHostInfo]} -- XXX: RemoteHostInfo is mostly concerned with session setup
| CRRemoteHostConnected {remoteHostId :: RemoteHostId}
| CRRemoteHostCreated {remoteHost :: RemoteHostInfo}
| CRRemoteHostList {remoteHosts :: [RemoteHostInfo]}
| CRRemoteHostConnected {remoteHostId :: RemoteHostId} -- TODO add displayName
| CRRemoteHostStopped {remoteHostId :: RemoteHostId}
| CRRemoteCtrlList {remoteCtrls :: [RemoteCtrlInfo]}
| CRRemoteCtrlRegistered {remoteCtrlId :: RemoteCtrlId}
@@ -692,7 +694,8 @@ logResponseToFile = \case
_ -> False
data RemoteCtrlOOB = RemoteCtrlOOB
{ caFingerprint :: C.KeyHash
{ caFingerprint :: C.KeyHash,
displayName :: Text
}
deriving (Show, Generic, FromJSON)
@@ -702,6 +705,7 @@ data RemoteHostInfo = RemoteHostInfo
{ remoteHostId :: RemoteHostId,
storePath :: FilePath,
displayName :: Text,
remoteCtrlOOB :: RemoteCtrlOOB,
sessionActive :: Bool
}
deriving (Show, Generic, FromJSON)