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 jsonSignal = ($p0).parseJson
let signalType = $jsonSignal["type"].getStr let signalType = $jsonSignal["type"].getStr
# TODO: ideally the signal would receive an object
# formatted for easier usage
case signalType: case signalType:
of "messages.new": of "messages.new":
state.nextSignal(SignalType.Message, $jsonSignal) state.nextSignal(SignalType.Message, $jsonSignal)

View File

@ -1,10 +1,16 @@
import hashes
type SignalCallback* = proc(eventMessage: cstring): void type SignalCallback* = proc(eventMessage: cstring): void
type SignalType* {.pure.} = enum type SignalType* {.pure.} = enum
Message = "messages.new" Message = "messages.new"
Wallet = "wallet" Wallet = "wallet"
NodeStarted = "node.started" 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 Unknown
#TODO: add missing types