mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 23:36:30 +03:00
stufff
This commit is contained in:
@@ -191,9 +191,11 @@ async fn subscribe_loop(
|
|||||||
let event = stream.recv().await?;
|
let event = stream.recv().await?;
|
||||||
match event {
|
match event {
|
||||||
IrohEvent::NeighborUp(node) => {
|
IrohEvent::NeighborUp(node) => {
|
||||||
|
info!(context, "NeighborUp: {:?}", node);
|
||||||
context.add_peer_for_topic(msg_id, topic, node).await?;
|
context.add_peer_for_topic(msg_id, topic, node).await?;
|
||||||
}
|
}
|
||||||
IrohEvent::NeighborDown(node) => {
|
IrohEvent::NeighborDown(node) => {
|
||||||
|
info!(context, "NeighborDown: {:?}", node);
|
||||||
context.delete_peer_for_topic(topic, node).await?;
|
context.delete_peer_for_topic(topic, node).await?;
|
||||||
}
|
}
|
||||||
IrohEvent::Received(event) => {
|
IrohEvent::Received(event) => {
|
||||||
|
|||||||
@@ -441,11 +441,6 @@ pub(crate) async fn receive_imf_inner(
|
|||||||
// join advertised gossip topics
|
// join advertised gossip topics
|
||||||
Ok((topics, instance_id)) => {
|
Ok((topics, instance_id)) => {
|
||||||
warn!(context, "Joining topics: {:#?}", topics);
|
warn!(context, "Joining topics: {:#?}", topics);
|
||||||
warn!(
|
|
||||||
context,
|
|
||||||
"{:?}",
|
|
||||||
mime_parser.get_header(HeaderDef::IrohPublicGossip)
|
|
||||||
);
|
|
||||||
if let Some(node_addr) = mime_parser.get_header(HeaderDef::IrohPublicGossip) {
|
if let Some(node_addr) = mime_parser.get_header(HeaderDef::IrohPublicGossip) {
|
||||||
match serde_json::from_str::<NodeAddr>(node_addr)
|
match serde_json::from_str::<NodeAddr>(node_addr)
|
||||||
.context("Failed to parse node address")
|
.context("Failed to parse node address")
|
||||||
|
|||||||
@@ -515,14 +515,13 @@ impl Context {
|
|||||||
let topic = TopicId::from_str(&iroh_base::base32::fmt(
|
let topic = TopicId::from_str(&iroh_base::base32::fmt(
|
||||||
topic.get(0..32).context("Can't get 32 bytes from topic")?,
|
topic.get(0..32).context("Can't get 32 bytes from topic")?,
|
||||||
))?;
|
))?;
|
||||||
self.join_and_subscribe_topic(topic, instance_msg_id)
|
|
||||||
.await?;
|
|
||||||
if !topic_exists {
|
if !topic_exists {
|
||||||
info!(
|
info!(
|
||||||
self,
|
self,
|
||||||
"Gossip topic {topic} does not exist, sending over smtp",
|
"Gossip topic {topic} does not exist, sending over smtp",
|
||||||
);
|
);
|
||||||
let addr = self
|
let node_id = self
|
||||||
.endpoint
|
.endpoint
|
||||||
.lock()
|
.lock()
|
||||||
.await
|
.await
|
||||||
@@ -530,9 +529,11 @@ impl Context {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.my_addr()
|
.my_addr()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap()
|
||||||
|
.node_id;
|
||||||
self.add_peer_for_topic(instance_msg_id, topic, addr.node_id)
|
self.join_and_subscribe_topic(topic, instance_msg_id)
|
||||||
|
.await?;
|
||||||
|
self.add_peer_for_topic(instance_msg_id, topic, node_id)
|
||||||
.await?;
|
.await?;
|
||||||
ephemeral = false;
|
ephemeral = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -940,7 +941,6 @@ pub async fn join_gossip_topic(ctx: &Context, msg_id: MsgId, topic: &str) -> Res
|
|||||||
let topic = TopicId::from_str(&iroh_base::base32::fmt(
|
let topic = TopicId::from_str(&iroh_base::base32::fmt(
|
||||||
topic.get(0..32).context("Can't get 32 bytes from topic")?,
|
topic.get(0..32).context("Can't get 32 bytes from topic")?,
|
||||||
))?;
|
))?;
|
||||||
info!(ctx, "Received join request from frontend");
|
|
||||||
ctx.join_and_subscribe_topic(topic, msg_id).await
|
ctx.join_and_subscribe_topic(topic, msg_id).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user