core: add commands that will not be forwarded to connected mobile (#3398)

* core: add commands that will not be forwarded to connected mobile

* fail if command that must be executed locally sent to remote host
This commit is contained in:
Evgeny Poberezkin
2023-11-19 20:48:25 +00:00
committed by GitHub
parent d9031cb209
commit 2a8d7b8926
3 changed files with 19 additions and 3 deletions
+3 -1
View File
@@ -400,7 +400,9 @@ execChatCommand rh s = do
case parseChatCommand s of
Left e -> pure $ chatCmdError u e
Right cmd -> case rh of
Just remoteHostId | allowRemoteCommand cmd -> execRemoteCommand u remoteHostId cmd s
Just rhId
| allowRemoteCommand cmd -> execRemoteCommand u rhId cmd s
| otherwise -> pure $ CRChatCmdError u $ ChatErrorRemoteHost (RHId rhId) $ RHELocalCommand
_ -> execChatCommand_ u cmd
execChatCommand' :: ChatMonad' m => ChatCommand -> m ChatResponse