mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-11-22 10:07:43 +00:00
ntf server: additional statistics (#1558)
* ntf server: additional statistics * version * fix stats * add stats to track notifications without active token * refactor * fix stats parser * version
This commit is contained in:
1 parent
3df2425162
commit
46ff37c362
6 files changed
+158
-33
No files matched your search
@@ -43,7 +43,7 @@ import qualified Data.X509 as X
|
||||
import qualified Data.X509.Validation as XV
|
||||
import Simplex.Messaging.Encoding
|
||||
import Simplex.Messaging.Parsers (parseAll)
|
||||
import Simplex.Messaging.Util (bshow, (<$?>))
|
||||
import Simplex.Messaging.Util (bshow, safeDecodeUtf8, (<$?>))
|
||||
|
||||
class TextEncoding a where
|
||||
textEncode :: a -> Text
|
||||
@@ -91,6 +91,10 @@ instance StrEncoding String where
|
||||
strEncode = strEncode . B.pack
|
||||
strP = B.unpack <$> strP
|
||||
|
||||
instance StrEncoding Text where
|
||||
strEncode = encodeUtf8
|
||||
strP = safeDecodeUtf8 <$> A.takeTill (\c -> c == ' ' || c == '\n')
|
||||
|
||||
instance ToJSON Str where
|
||||
toJSON (Str s) = strToJSON s
|
||||
toEncoding (Str s) = strToJEncoding s
|
||||
|
||||
Reference in new issue
Block a user