feat: add mailserver request signals

This commit is contained in:
Richard Ramos 2021-09-22 16:03:25 -04:00 committed by Iuri Matias
parent 176b559877
commit 85250211ea
1 changed files with 11 additions and 0 deletions

View File

@ -123,6 +123,17 @@ proc init*(self: ProfileController, account: Account) =
let mailserverArg = MailserverArgs(e)
self.view.mailservers.activeMailserverChanged(mailserverArg.peer)
self.status.events.on(SignalType.HistoryRequestStarted.event) do(e: Args):
info "history request started", topics="mailserver-interaction"
self.status.events.on(SignalType.HistoryRequestCompleted.event) do(e: Args):
info "history request completed", topics="mailserver-interaction"
self.status.events.on(SignalType.HistoryRequestFailed.event) do(e: Args):
let h = HistoryRequestFailedSignal(e)
info "history request failed", topics="mailserver-interaction", errorMessage=h.errorMessage
self.status.events.on(SignalType.Message.event) do(e: Args):
let msgData = MessageSignal(e);
if msgData.contacts.len > 0: