mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
update readme and version in code (#147)
* update readme and version in code * Update README.md * Update README.md Co-authored-by: Patryk Laurent <plaurent@me.com> Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com> Co-authored-by: Patryk Laurent <plaurent@me.com>
This commit is contained in:
parent
177c007edc
commit
1564424f0d
6 changed files with 13 additions and 162 deletions
12
README.md
12
README.md
|
@ -11,6 +11,10 @@
|
||||||
|
|
||||||
SimpleX chat prototype is a thin terminal UI on top of [SimpleXMQ](https://github.com/simplex-chat/simplexmq) message broker that uses [SMP protocols](https://github.com/simplex-chat/simplexmq/blob/master/protocol). The motivation for SimpleX chat is [presented here](./simplex.md). See [simplex.chat](https://simplex.chat) website for chat demo and the explanations of the system and how SMP protocol works.
|
SimpleX chat prototype is a thin terminal UI on top of [SimpleXMQ](https://github.com/simplex-chat/simplexmq) message broker that uses [SMP protocols](https://github.com/simplex-chat/simplexmq/blob/master/protocol). The motivation for SimpleX chat is [presented here](./simplex.md). See [simplex.chat](https://simplex.chat) website for chat demo and the explanations of the system and how SMP protocol works.
|
||||||
|
|
||||||
|
**NEW in v0.5.0: [user contact addresses](#user-contact-addresses-alpha)!**
|
||||||
|
|
||||||
|
**Please note**: v0.5.0 of SimpleX Chat works with the same database, but the connection links are not compatible with the previous version - please ask all your contacts to upgrade!
|
||||||
|
|
||||||
### :zap: Quick installation
|
### :zap: Quick installation
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -55,7 +59,7 @@ We appreciate all the help from our contributors, thank you!
|
||||||
- [How to use SimpleX chat](#how-to-use-simplex-chat)
|
- [How to use SimpleX chat](#how-to-use-simplex-chat)
|
||||||
- [Groups](#groups)
|
- [Groups](#groups)
|
||||||
- [Sending files](#sending-files)
|
- [Sending files](#sending-files)
|
||||||
- [User contact addresses](#user-contact-addresses)
|
- [User contact addresses](#user-contact-addresses-alpha)
|
||||||
- [Access chat history](#access-chat-history)
|
- [Access chat history](#access-chat-history)
|
||||||
- [Roadmap](#Roadmap)
|
- [Roadmap](#Roadmap)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
@ -80,8 +84,6 @@ The routing of messages relies on the knowledge of client devices how user conta
|
||||||
|
|
||||||
## Terminal chat features
|
## Terminal chat features
|
||||||
|
|
||||||
**NEW in v0.4.3: [user contact addresses](#user-contact-addresses)!**
|
|
||||||
|
|
||||||
- 1-to-1 chat with multiple people in the same terminal window.
|
- 1-to-1 chat with multiple people in the same terminal window.
|
||||||
- Group messaging.
|
- Group messaging.
|
||||||
- Sending files to contacts and groups.
|
- Sending files to contacts and groups.
|
||||||
|
@ -256,7 +258,7 @@ You can send a file to your contact with `/f @<contact> <file_path>` - the recip
|
||||||
|
|
||||||
You can send files to a group with `/f #<group> <file_path>`.
|
You can send files to a group with `/f #<group> <file_path>`.
|
||||||
|
|
||||||
### User contact addresses
|
### User contact addresses (alpha)
|
||||||
|
|
||||||
As an alternative to one-time invitation links, you can create a long-term address with `/ad` (for `/address`). The created address can then be shared via any channel, and used by other users as a link to make a contact request with `/c <user_contact_address>`.
|
As an alternative to one-time invitation links, you can create a long-term address with `/ad` (for `/address`). The created address can then be shared via any channel, and used by other users as a link to make a contact request with `/c <user_contact_address>`.
|
||||||
|
|
||||||
|
@ -266,7 +268,7 @@ User address is "long-term" in a sense that it is a multiple-use connection link
|
||||||
|
|
||||||
Use `/help address` for other commands.
|
Use `/help address` for other commands.
|
||||||
|
|
||||||
> :warning: **Please note:** This is a beta feature - at the moment only request throttling is implemented as a countermeasure against spam.
|
> :warning: **Please note:** This is an "alpha" feature - at the moment there is nothing to prevent someone who has obtained this address from spamming you with connection requests; countermeasures will be added soon! (In the short term, you can simply delete the long-term address you created if it starts getting abused.)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
|
@ -1,119 +0,0 @@
|
||||||
{-# LANGUAGE LambdaCase #-}
|
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
|
||||||
|
|
||||||
module Demo where
|
|
||||||
|
|
||||||
import Simplex.Chat.Styled
|
|
||||||
import System.Console.ANSI.Types
|
|
||||||
import System.Terminal
|
|
||||||
|
|
||||||
someViewUpdate :: Monad m => m ()
|
|
||||||
someViewUpdate = pure ()
|
|
||||||
|
|
||||||
chatLayoutDemo :: MonadTerminal m => m ()
|
|
||||||
chatLayoutDemo =
|
|
||||||
mapM_
|
|
||||||
putStyledLn
|
|
||||||
[ " search " <> Styled gray "(ctrl-s) " <> lineV <> Styled toContact " @bob " <> "Bob Roberts " <> Styled greenColor "@john" <> "",
|
|
||||||
" " <> lineV <> Styled gray " 14:15 online profile (ctrl-p)",
|
|
||||||
lineH 20 <> crossover <> lineH 59,
|
|
||||||
"* " <> Styled [SetConsoleIntensity BoldIntensity] "all chats " <> " " <> lineV <> "",
|
|
||||||
Styled gray " (ctrl-a) " <> lineV <> "",
|
|
||||||
"*" <> Styled toContact " @alice " <> Styled darkGray "14:37 " <> lineV <> "",
|
|
||||||
Styled gray " Hello there! ... " <> lineV <> "",
|
|
||||||
Styled selected " " <> Styled (toContact <> selected) " @bob " <> Styled (selected <> gray) "12:35 " <> lineV <> "",
|
|
||||||
Styled selected " All good, John... " <> lineV <> "",
|
|
||||||
"*" <> Styled group " #team " <> Styled darkGray "10:55 " <> lineV <> "",
|
|
||||||
Styled gray " What's up ther... " <> lineV <> "",
|
|
||||||
" " <> Styled toContact " @tom " <> Styled darkGray "Wed " <> lineV <> "",
|
|
||||||
Styled gray " Have you seen ... " <> lineV <> "",
|
|
||||||
" " <> lineV,
|
|
||||||
" " <> lineV,
|
|
||||||
" " <> lineV,
|
|
||||||
" " <> lineV,
|
|
||||||
" " <> lineV,
|
|
||||||
" " <> lineV <> Styled greenColor " ✔︎" <> Styled darkGray " 12:30" <> Styled toContact " @bob" <> " hey bob - how is it going?",
|
|
||||||
" " <> lineV <> Styled greenColor " ✔︎" <> Styled darkGray " " <> Styled toContact " " <> " let's meet soon!",
|
|
||||||
" " <> lineV <> " *" <> Styled darkGray " 12:35" <> Styled contact " bob>" <> " All good, John! How are you?",
|
|
||||||
" " <> teeL <> lineH 59,
|
|
||||||
" " <> lineV <> " > " <> Styled toContact "@bob" <> " 😀 This is the message that will be sent to @bob"
|
|
||||||
]
|
|
||||||
>> putStyled (Styled ctrlKeys " help (ctrl-h) new contact (ctrl-n) choose chat (ctrl-↓↑) new group (ctrl-g) ")
|
|
||||||
|
|
||||||
contact :: [SGR]
|
|
||||||
contact = [SetConsoleIntensity BoldIntensity, SetColor Foreground Vivid Yellow]
|
|
||||||
|
|
||||||
toContact :: [SGR]
|
|
||||||
toContact = [SetConsoleIntensity BoldIntensity, SetColor Foreground Vivid Cyan]
|
|
||||||
|
|
||||||
group :: [SGR]
|
|
||||||
group = [SetConsoleIntensity BoldIntensity, SetColor Foreground Vivid Cyan]
|
|
||||||
|
|
||||||
selected :: [SGR]
|
|
||||||
selected = [SetColor Background Vivid Black]
|
|
||||||
|
|
||||||
ctrlKeys :: [SGR]
|
|
||||||
ctrlKeys = [SetColor Background Dull White, SetColor Foreground Dull Black]
|
|
||||||
|
|
||||||
gray :: [SGR]
|
|
||||||
gray = [SetColor Foreground Dull White]
|
|
||||||
|
|
||||||
darkGray :: [SGR]
|
|
||||||
darkGray = [SetColor Foreground Vivid Black]
|
|
||||||
|
|
||||||
greenColor :: [SGR]
|
|
||||||
greenColor = [SetColor Foreground Vivid Green]
|
|
||||||
|
|
||||||
lineV :: StyledString
|
|
||||||
lineV = Styled selected " " -- "\x2502"
|
|
||||||
|
|
||||||
lineH :: Int -> StyledString
|
|
||||||
lineH n = Styled darkGray $ replicate n '\x2500'
|
|
||||||
|
|
||||||
teeL :: StyledString
|
|
||||||
teeL = Styled selected " " -- "\x251C"
|
|
||||||
|
|
||||||
crossover :: StyledString
|
|
||||||
crossover = Styled selected " " -- "\x253C"
|
|
||||||
|
|
||||||
putStyledLn :: MonadTerminal m => StyledString -> m ()
|
|
||||||
putStyledLn s = putStyled s >> putLn
|
|
||||||
|
|
||||||
putStyled :: MonadTerminal m => StyledString -> m ()
|
|
||||||
putStyled (s1 :<>: s2) = putStyled s1 >> putStyled s2
|
|
||||||
putStyled (Styled [] s) = putString s
|
|
||||||
putStyled (Styled sgr s) = setSGR sgr >> putString s >> resetAttributes
|
|
||||||
|
|
||||||
setSGR :: MonadTerminal m => [SGR] -> m ()
|
|
||||||
setSGR = mapM_ $ \case
|
|
||||||
Reset -> resetAttributes
|
|
||||||
SetConsoleIntensity BoldIntensity -> setAttribute bold
|
|
||||||
SetConsoleIntensity _ -> resetAttribute bold
|
|
||||||
SetItalicized True -> setAttribute italic
|
|
||||||
SetItalicized _ -> resetAttribute italic
|
|
||||||
SetUnderlining NoUnderline -> resetAttribute underlined
|
|
||||||
SetUnderlining _ -> setAttribute underlined
|
|
||||||
SetSwapForegroundBackground True -> setAttribute inverted
|
|
||||||
SetSwapForegroundBackground _ -> resetAttribute inverted
|
|
||||||
SetColor l i c -> setAttribute . layer l . intensity i $ color c
|
|
||||||
SetBlinkSpeed _ -> pure ()
|
|
||||||
SetVisible _ -> pure ()
|
|
||||||
SetRGBColor _ _ -> pure ()
|
|
||||||
SetPaletteColor _ _ -> pure ()
|
|
||||||
SetDefaultColor _ -> pure ()
|
|
||||||
where
|
|
||||||
layer = \case
|
|
||||||
Foreground -> foreground
|
|
||||||
Background -> background
|
|
||||||
intensity = \case
|
|
||||||
Dull -> id
|
|
||||||
Vivid -> bright
|
|
||||||
color = \case
|
|
||||||
Black -> black
|
|
||||||
Red -> red
|
|
||||||
Green -> green
|
|
||||||
Yellow -> yellow
|
|
||||||
Blue -> blue
|
|
||||||
Magenta -> magenta
|
|
||||||
Cyan -> cyan
|
|
||||||
White -> white
|
|
|
@ -25,35 +25,3 @@ welcomeGetOpts = do
|
||||||
putStrLn $ "db: " <> dbFile <> ".chat.db, " <> dbFile <> ".agent.db"
|
putStrLn $ "db: " <> dbFile <> ".chat.db, " <> dbFile <> ".agent.db"
|
||||||
putStrLn "type \"/help\" or \"/h\" for usage info"
|
putStrLn "type \"/help\" or \"/h\" for usage info"
|
||||||
pure opts
|
pure opts
|
||||||
|
|
||||||
-- defaultSettings :: C.Size -> C.VirtualTerminalSettings
|
|
||||||
-- defaultSettings size =
|
|
||||||
-- C.VirtualTerminalSettings
|
|
||||||
-- { C.virtualType = "xterm",
|
|
||||||
-- C.virtualWindowSize = pure size,
|
|
||||||
-- C.virtualEvent = retry,
|
|
||||||
-- C.virtualInterrupt = retry
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- main :: IO ()
|
|
||||||
-- main = do
|
|
||||||
-- void $ createStore "simplex-chat.db" 4
|
|
||||||
|
|
||||||
-- hFlush stdout
|
|
||||||
-- -- ChatTerminal {termSize} <- newChatTerminal
|
|
||||||
-- -- pos <- C.withVirtualTerminal (defaultSettings termSize) $
|
|
||||||
-- -- \t -> runTerminalT (C.setAlternateScreenBuffer True >> C.putString "a" >> C.flush >> C.getCursorPosition) t
|
|
||||||
-- -- print pos
|
|
||||||
-- -- race_ (printEvents t) (updateTerminal t)
|
|
||||||
-- void . withTerminal . runTerminalT $ chatLayoutDemo >> C.flush >> C.awaitEvent
|
|
||||||
|
|
||||||
-- printEvents :: C.VirtualTerminal -> IO ()
|
|
||||||
-- printEvents t = forever $ do
|
|
||||||
-- event <- withTerminal . runTerminalT $ C.flush >> C.awaitEvent
|
|
||||||
-- runTerminalT (putStringLn $ show event) t
|
|
||||||
|
|
||||||
-- updateTerminal :: C.VirtualTerminal -> IO ()
|
|
||||||
-- updateTerminal t = forever $ do
|
|
||||||
-- threadDelay 10000
|
|
||||||
-- win <- readTVarIO $ C.virtualWindow t
|
|
||||||
-- withTerminal . runTerminalT $ mapM_ C.putStringLn win >> C.flush
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: simplex-chat
|
name: simplex-chat
|
||||||
version: 0.4.2
|
version: 0.5.0
|
||||||
#synopsis:
|
#synopsis:
|
||||||
#description:
|
#description:
|
||||||
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
||||||
|
@ -29,7 +29,7 @@ dependencies:
|
||||||
- optparse-applicative == 0.15.*
|
- optparse-applicative == 0.15.*
|
||||||
- process == 1.6.*
|
- process == 1.6.*
|
||||||
- simple-logger == 0.1.*
|
- simple-logger == 0.1.*
|
||||||
- simplexmq == 0.4.*
|
- simplexmq == 0.5.*
|
||||||
- sqlite-simple == 0.4.*
|
- sqlite-simple == 0.4.*
|
||||||
- stm == 2.5.*
|
- stm == 2.5.*
|
||||||
- terminal == 0.2.*
|
- terminal == 0.2.*
|
||||||
|
|
|
@ -26,7 +26,7 @@ import System.IO (Handle)
|
||||||
import UnliftIO.STM
|
import UnliftIO.STM
|
||||||
|
|
||||||
versionNumber :: String
|
versionNumber :: String
|
||||||
versionNumber = "0.4.2"
|
versionNumber = "0.5.0"
|
||||||
|
|
||||||
data ChatConfig = ChatConfig
|
data ChatConfig = ChatConfig
|
||||||
{ agentConfig :: AgentConfig,
|
{ agentConfig :: AgentConfig,
|
||||||
|
|
|
@ -40,10 +40,10 @@ extra-deps:
|
||||||
- simple-logger-0.1.0@sha256:be8ede4bd251a9cac776533bae7fb643369ebd826eb948a9a18df1a8dd252ff8,1079
|
- simple-logger-0.1.0@sha256:be8ede4bd251a9cac776533bae7fb643369ebd826eb948a9a18df1a8dd252ff8,1079
|
||||||
- sqlite-simple-0.4.18.0@sha256:3ceea56375c0a3590c814e411a4eb86943f8d31b93b110ca159c90689b6b39e5,3002
|
- sqlite-simple-0.4.18.0@sha256:3ceea56375c0a3590c814e411a4eb86943f8d31b93b110ca159c90689b6b39e5,3002
|
||||||
- terminal-0.2.0.0@sha256:de6770ecaae3197c66ac1f0db5a80cf5a5b1d3b64a66a05b50f442de5ad39570,2977
|
- terminal-0.2.0.0@sha256:de6770ecaae3197c66ac1f0db5a80cf5a5b1d3b64a66a05b50f442de5ad39570,2977
|
||||||
# - simplexmq-0.4.1@sha256:3a1bc40d85e4e398458e5b9b79757e0af4fe27b8ef44eb3157f7f1e07412a8e8,7640
|
- simplexmq-0.5.0@sha256:3d9b84d986df7409839c19455a376722837d52a646cb5d136037cadd0b5a4b76,7828
|
||||||
# - ../simplexmq
|
# - ../simplexmq
|
||||||
- github: simplex-chat/simplexmq
|
# - github: simplex-chat/simplexmq
|
||||||
commit: fe2d6607de44d6be468d3a3a1a8536cf85b4f237
|
# commit: f15067cf6891bda3216c6cf6d2e3ecdba9b7269e
|
||||||
#
|
#
|
||||||
# extra-deps: []
|
# extra-deps: []
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue