mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
fixes
This commit is contained in:
@@ -22,7 +22,7 @@ impl Context {
|
|||||||
if self.endpoint.lock().await.is_some() {
|
if self.endpoint.lock().await.is_some() {
|
||||||
warn!(
|
warn!(
|
||||||
self,
|
self,
|
||||||
"Tried to create gossip even tough there still exists an instance"
|
"Tried to create endpoint even though there is already one."
|
||||||
);
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -501,6 +501,11 @@ impl Context {
|
|||||||
if send_now {
|
if send_now {
|
||||||
if let Some(ref topic) = status_update.gossip_topic {
|
if let Some(ref topic) = status_update.gossip_topic {
|
||||||
// find out if any row with `topic = topic` exists in the gossip_peers table
|
// find out if any row with `topic = topic` exists in the gossip_peers table
|
||||||
|
|
||||||
|
let topic = TopicId::from_str(&iroh_base::base32::fmt(
|
||||||
|
topic.get(0..32).context("Can't get 32 bytes from topic")?,
|
||||||
|
))?;
|
||||||
|
|
||||||
let topic_exists = self
|
let topic_exists = self
|
||||||
.sql
|
.sql
|
||||||
.query_row_optional(
|
.query_row_optional(
|
||||||
@@ -512,10 +517,6 @@ impl Context {
|
|||||||
.context("Failed to check if gossip topic exists")?
|
.context("Failed to check if gossip topic exists")?
|
||||||
.is_some();
|
.is_some();
|
||||||
|
|
||||||
let topic = TopicId::from_str(&iroh_base::base32::fmt(
|
|
||||||
topic.get(0..32).context("Can't get 32 bytes from topic")?,
|
|
||||||
))?;
|
|
||||||
|
|
||||||
if !topic_exists {
|
if !topic_exists {
|
||||||
info!(
|
info!(
|
||||||
self,
|
self,
|
||||||
@@ -531,10 +532,10 @@ impl Context {
|
|||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.node_id;
|
.node_id;
|
||||||
self.join_and_subscribe_topic(topic, instance_msg_id)
|
|
||||||
.await?;
|
|
||||||
self.add_peer_for_topic(instance_msg_id, topic, node_id)
|
self.add_peer_for_topic(instance_msg_id, topic, node_id)
|
||||||
.await?;
|
.await?;
|
||||||
|
self.join_and_subscribe_topic(topic, instance_msg_id)
|
||||||
|
.await?;
|
||||||
ephemeral = false;
|
ephemeral = false;
|
||||||
} else {
|
} else {
|
||||||
if let Some(ref gossip) = *self.gossip.lock().await {
|
if let Some(ref gossip) = *self.gossip.lock().await {
|
||||||
|
|||||||
Reference in New Issue
Block a user