Adding missing signals

This commit is contained in:
Richard Ramos 2020-05-13 18:24:46 -04:00 committed by Iuri Matias
parent ba2fc5eb73
commit ed0059d48f
2 changed files with 11 additions and 3 deletions

View File

@ -8,6 +8,8 @@ proc onSignal*(state: AppState): SignalCallback =
let jsonSignal = ($p0).parseJson
let signalType = $jsonSignal["type"].getStr
# TODO: ideally the signal would receive an object
# formatted for easier usage
case signalType:
of "messages.new":
state.nextSignal(SignalType.Message, $jsonSignal)

View File

@ -1,10 +1,16 @@
import hashes
type SignalCallback* = proc(eventMessage: cstring): void
type SignalType* {.pure.} = enum
Message = "messages.new"
Wallet = "wallet"
NodeStarted = "node.started"
NodeLogin = "node.login"
EnvelopeSent = "envelope.sent"
EnvelopeExpired = "envelope.expired"
MailserverRequestCompleted = "mailserver.request.completed"
MailserverRequestExpired = "mailserver.request.expired"
DiscoverSummary = "discover.summary"
SubscriptionsData = "subscriptions.data"
SubscriptionsError = "subscriptions.error"
WhisperFilterAdded = "whisper.filter.added"
Unknown
#TODO: add missing types