diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2020-01-16 21:54:03 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2020-01-16 21:54:03 +0100 |
commit | 0edb161e760197fcc371644a318ba745d966c95e (patch) | |
tree | 2664d491a318623a69ba3b48636d56a15cdc0abf /src/Main.hs | |
parent | 95e8a0478c3b5e4610fa28e408800cc027b2b85c (diff) |
Use UUID for service types
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs index b143253..e23e1b5 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -19,6 +19,7 @@ import Data.Maybe import qualified Data.Text as T import qualified Data.Text.IO as T import Data.Time.LocalTime +import Data.Typeable import System.Console.Haskeline import System.Environment @@ -94,8 +95,8 @@ interactiveLoop st bhost = runInputT defaultSettings $ do chanPeer <- liftIO $ do erebosHead <- loadLocalStateHead st startServer erebosHead extPrintLn bhost - [ (T.pack "attach", SomeService (emptyServiceState :: AttachService)) - , (T.pack "dmsg", SomeService (emptyServiceState :: DirectMessageService)) + [ SomeService @AttachService Proxy + , SomeService @DirectMessageService Proxy ] peers <- liftIO $ newMVar [] @@ -224,7 +225,7 @@ cmdSend = void $ do (,smsg) <$> slistAddS thread' (lsMessages $ fromStored erb) erb' <- wrappedStore st (fromStored erb) { lsMessages = slist } return (erb', smsg) - sendToPeer self peer (T.pack "dmsg") smsg + sendToPeer self peer $ DirectMessagePacket smsg tzone <- liftIO $ getCurrentTimeZone liftIO $ putStrLn $ formatMessage tzone $ fromStored smsg |