2018-04-11 15:41:51 +00:00
|
|
|
package shhext
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2018-05-03 07:35:58 +00:00
|
|
|
"github.com/status-im/status-go/signal"
|
2018-04-11 15:41:51 +00:00
|
|
|
)
|
|
|
|
|
2018-04-13 05:52:22 +00:00
|
|
|
// EnvelopeSignalHandler sends signals when envelope is sent or expired.
|
|
|
|
type EnvelopeSignalHandler struct{}
|
|
|
|
|
|
|
|
// EnvelopeSent triggered when envelope delivered atleast to 1 peer.
|
|
|
|
func (h EnvelopeSignalHandler) EnvelopeSent(hash common.Hash) {
|
2018-05-03 07:35:58 +00:00
|
|
|
signal.SendEnvelopeSent(hash)
|
2018-04-13 05:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// EnvelopeExpired triggered when envelope is expired but wasn't delivered to any peer.
|
|
|
|
func (h EnvelopeSignalHandler) EnvelopeExpired(hash common.Hash) {
|
2018-05-03 07:35:58 +00:00
|
|
|
signal.SendEnvelopeExpired(hash)
|
2018-04-11 15:41:51 +00:00
|
|
|
}
|
2018-06-15 15:12:31 +00:00
|
|
|
|
|
|
|
// MailServerRequestCompleted triggered when mailserver send a ack with a requesID sent previously
|
|
|
|
func (h EnvelopeSignalHandler) MailServerRequestCompleted(hash common.Hash) {
|
|
|
|
signal.SendMailServerRequestCompleted(hash)
|
|
|
|
}
|
|
|
|
|
|
|
|
// MailServerRequestExpired triggered when mail server request expires
|
|
|
|
func (h EnvelopeSignalHandler) MailServerRequestExpired(hash common.Hash) {
|
|
|
|
signal.SendMailServerRequestExpired(hash)
|
|
|
|
}
|