mirror of
https://github.com/status-im/whisper.git
synced 2025-02-22 07:28:16 +00:00
add Topic to EnvelopeEvent
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
7ab066bada
commit
f326756ecf
@ -38,6 +38,7 @@ const (
|
||||
// EnvelopeEvent used for envelopes events.
|
||||
type EnvelopeEvent struct {
|
||||
Event EventType
|
||||
Topic TopicType
|
||||
Hash common.Hash
|
||||
Batch common.Hash
|
||||
Peer enode.ID
|
||||
|
@ -441,6 +441,7 @@ func (whisper *Whisper) RequestHistoricMessagesWithTimeout(peerID []byte, envelo
|
||||
}
|
||||
whisper.envelopeFeed.Send(EnvelopeEvent{
|
||||
Peer: p.peer.ID(),
|
||||
Topic: envelope.Topic,
|
||||
Hash: envelope.Hash(),
|
||||
Event: EventMailServerRequestSent,
|
||||
})
|
||||
@ -957,6 +958,7 @@ func (whisper *Whisper) runMessageLoop(p *Peer, rw p2p.MsgReadWriter) error {
|
||||
|
||||
whisper.envelopeFeed.Send(EnvelopeEvent{
|
||||
Event: EventEnvelopeReceived,
|
||||
Topic: env.Topic,
|
||||
Hash: env.Hash(),
|
||||
Peer: p.peer.ID(),
|
||||
})
|
||||
@ -1280,6 +1282,7 @@ func (whisper *Whisper) add(envelope *Envelope, isP2P bool) (bool, error) {
|
||||
if whisper.mailServer != nil {
|
||||
whisper.mailServer.Archive(envelope)
|
||||
whisper.envelopeFeed.Send(EnvelopeEvent{
|
||||
Topic: envelope.Topic,
|
||||
Hash: envelope.Hash(),
|
||||
Event: EventMailServerEnvelopeArchived,
|
||||
})
|
||||
@ -1329,6 +1332,7 @@ func (whisper *Whisper) processQueue() {
|
||||
case e := <-whisper.messageQueue:
|
||||
whisper.filters.NotifyWatchers(e, false)
|
||||
whisper.envelopeFeed.Send(EnvelopeEvent{
|
||||
Topic: e.Topic,
|
||||
Hash: e.Hash(),
|
||||
Event: EventEnvelopeAvailable,
|
||||
})
|
||||
@ -1346,6 +1350,7 @@ func (whisper *Whisper) processP2P() {
|
||||
case *Envelope:
|
||||
whisper.filters.NotifyWatchers(event, true)
|
||||
whisper.envelopeFeed.Send(EnvelopeEvent{
|
||||
Topic: event.Topic,
|
||||
Hash: event.Hash(),
|
||||
Event: EventEnvelopeAvailable,
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user