mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 14:36:29 +03:00
add gossip join api
webxdcs can now have multiple gossip channels and decide where to send the message to.
This commit is contained in:
12
src/tools.rs
12
src/tools.rs
@@ -8,14 +8,13 @@ use std::fmt;
|
||||
use std::io::{Cursor, Write};
|
||||
use std::mem;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::{from_utf8, FromStr};
|
||||
use std::str::from_utf8;
|
||||
use std::time::{Duration, SystemTime};
|
||||
|
||||
use anyhow::{bail, Context as _, Result};
|
||||
use base64::Engine as _;
|
||||
use chrono::{Local, NaiveDateTime, NaiveTime, TimeZone};
|
||||
use futures::{StreamExt, TryStreamExt};
|
||||
use iroh_gossip::proto::TopicId;
|
||||
use mailparse::dateparse;
|
||||
use mailparse::headers::Headers;
|
||||
use mailparse::MailHeaderMap;
|
||||
@@ -744,15 +743,6 @@ pub(crate) fn strip_rtlo_characters(input_str: &str) -> String {
|
||||
input_str.replace(|char| RTLO_CHARACTERS.contains(&char), "")
|
||||
}
|
||||
|
||||
/// Generates a [TopicId] from some rfc724_mid.
|
||||
pub(crate) fn get_topic_from_msg_id(rfc724_mid: &str) -> Result<TopicId> {
|
||||
TopicId::from_str(&iroh_base::base32::fmt(
|
||||
rfc724_mid
|
||||
.get(0..32)
|
||||
.context("Can't get 32 bytes from rfc724_mid")?,
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#![allow(clippy::indexing_slicing)]
|
||||
|
||||
Reference in New Issue
Block a user