protocols/identify: Emit Push event after successful identification push (#2030)

This commit is contained in:
Max Inden
2021-04-10 19:46:57 +02:00
committed by GitHub
parent 6fdfb44a54
commit 7cf8ac0862
3 changed files with 24 additions and 3 deletions

View File

@ -79,6 +79,8 @@ pub struct IdentifyHandler {
pub enum IdentifyHandlerEvent {
/// We obtained identification information from the remote.
Identified(IdentifyInfo),
/// We actively pushed our identification information to the remote.
IdentificationPushed,
/// We received a request for identification.
Identify(ReplySubstream<NegotiatedSubstream>),
/// Failed to identify the remote.
@ -149,7 +151,8 @@ impl ProtocolsHandler for IdentifyHandler {
IdentifyHandlerEvent::Identified(remote_info)));
self.keep_alive = KeepAlive::No;
}
EitherOutput::Second(()) => {}
EitherOutput::Second(()) => self.events.push(
ProtocolsHandlerEvent::Custom(IdentifyHandlerEvent::IdentificationPushed))
}
}