use crate::error::ImError;
use crate::module::ImModule;
use crate::state::{ChannelId, CorrelationContext};
use helix_core::tick::PortOutcome;
use helix_core::{Effect, EffectSink};
impl ImModule {
pub(super) fn handle_message_v3_revoke_channel_persist_reply(
&mut self,
channel_id: ChannelId,
outcome: &PortOutcome,
out: &mut EffectSink,
) {
if !matches!(outcome, PortOutcome::Ok(_)) {
return;
}
let corr = self.alloc_corr_internal();
out.push(Effect::Persist {
corr,
ops: vec![crate::channel_write::message_v3_member_read_op(
channel_id,
self.config.auth_user_id.as_str(),
)],
});
self.state
.corr_map
.insert(corr, CorrelationContext::MessageV3RevokeChannelReadback);
}
pub(super) fn handle_message_v3_revoke_channel_readback_reply(
&mut self,
outcome: &PortOutcome,
out: &mut EffectSink,
) -> Result<(), ImError> {
if let Some(channel) = super::message_v3_post::channel_update_from_member_readback(outcome)?
{
out.push(channel.into_effect());
}
Ok(())
}
}