diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index f3d60419b2..6c35d408d4 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -324,7 +324,7 @@ data ChatController = ChatController contactMergeEnabled :: TVar Bool } -data HelpSection = HSMain | HSFiles | HSGroups | HSContacts | HSMyAddress | HSIncognito | HSMarkdown | HSMessages | HSRemote | HSSettings | HSDatabase +data HelpSection = HSMain | HSFiles | HSGroups | HSContacts | HSMyAddress | HSIncognito | HSMarkdown | HSMessages | HSRemote | HSSettings | HSDatabase | HSNames deriving (Show) data ChatCommand diff --git a/src/Simplex/Chat/Help.hs b/src/Simplex/Chat/Help.hs index 56ed65fb4b..08a8798b4e 100644 --- a/src/Simplex/Chat/Help.hs +++ b/src/Simplex/Chat/Help.hs @@ -14,6 +14,7 @@ module Simplex.Chat.Help markdownInfo, settingsInfo, databaseHelpInfo, + namesHelpInfo, ) where @@ -88,7 +89,7 @@ chatHelpInfo = green "Create your address: " <> highlight "/address", "", green "Other commands:", - indent <> highlight "/help " <> " - help on: " <> listHighlight ["groups", "contacts", "messages", "files", "address", "incognito", "remote", "settings", "db"], + indent <> highlight "/help " <> " - help on: " <> listHighlight ["groups", "contacts", "messages", "files", "address", "incognito", "remote", "settings", "db", "names"], indent <> highlight "/profile " <> " - show / update user profile", indent <> highlight "/delete " <> " - delete contact and all messages with them", indent <> highlight "/chats " <> " - most recent chats", @@ -218,6 +219,26 @@ myAddressHelpInfo = "The commands may be abbreviated: " <> listHighlight ["/ad", "/da", "/sa", "/ac", "/rc"] ] +namesHelpInfo :: [StyledString] +namesHelpInfo = + map + styleMarkdown + [ green "SimpleX name commands:", + indent <> highlight "/name register ", + indent <> indent <> " - register a name for your address or channel", + "", + green "Arguments:", + indent <> highlight " " <> " - address of the names service to register with", + indent <> highlight " " <> " - the name to register, e.g. " <> highlight "alice.simplex", + indent <> highlight "" <> " - the contact address or channel the name should resolve to", + "", + "Registration takes a few seconds: the name is committed first, and revealed", + "after a short wait, so the service cannot register it before you do.", + "", + "Please note: this is in development. The name is registered against a mock,", + "not a blockchain, and it cannot yet be edited, transferred or renewed." + ] + incognitoHelpInfo :: [StyledString] incognitoHelpInfo = map diff --git a/src/Simplex/Chat/Library/Commands.hs b/src/Simplex/Chat/Library/Commands.hs index 4f7605f109..0ca9b0a38b 100644 --- a/src/Simplex/Chat/Library/Commands.hs +++ b/src/Simplex/Chat/Library/Commands.hs @@ -5700,6 +5700,7 @@ chatCommandP = ("/help remote" <|> "/hr") $> ChatHelp HSRemote, ("/help settings" <|> "/hs") $> ChatHelp HSSettings, ("/help db" <|> "/hd") $> ChatHelp HSDatabase, + ("/help names" <|> "/help name" <|> "/hn") $> ChatHelp HSNames, ("/help" <|> "/h") $> ChatHelp HSMain, ("/group" <|> "/g") *> (NewGroup <$> incognitoP <* A.space <* char_ '#' <*> groupProfile), "/_group " *> (APINewGroup <$> A.decimal <*> incognitoOnOffP <* A.space <*> jsonP), diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index c9218edd41..b3274ae201 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -182,6 +182,7 @@ chatResponseToView hu cfg@ChatConfig {logLevel, showReactions, showFullLinks, te HSRemote -> remoteHelpInfo HSSettings -> settingsInfo HSDatabase -> databaseHelpInfo + HSNames -> namesHelpInfo CRWelcome user -> chatWelcome user CRContactsList u cs -> ttyUser u $ viewContactsList cs CRUserContactLink u UserContactLink {connLinkContact, addressSettings} -> ttyUser u $ connReqContact_ showFullLinks "Your chat address:" connLinkContact <> viewAddressSettings addressSettings