mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 02:16:29 +03:00
feat: upgrade to iroh@0.30.0
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::iter;
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::{Context as _, Result};
|
||||
use data_encoding::BASE32_NOPAD;
|
||||
use deltachat_contact_tools::{addr_cmp, may_be_valid_addr, sanitize_single_line, ContactAddress};
|
||||
use iroh_gossip::proto::TopicId;
|
||||
use mailparse::SingleInfo;
|
||||
@@ -1664,7 +1664,14 @@ RETURNING id
|
||||
// check if any part contains a webxdc topic id
|
||||
if part.typ == Viewtype::Webxdc {
|
||||
if let Some(topic) = mime_parser.get_header(HeaderDef::IrohGossipTopic) {
|
||||
let topic = TopicId::from_str(topic).context("wrong gossip topic header")?;
|
||||
// default encoding of topic ids is `hex`.
|
||||
let mut topic_raw = [0u8; 32];
|
||||
BASE32_NOPAD
|
||||
.decode_mut(topic.to_ascii_uppercase().as_bytes(), &mut topic_raw)
|
||||
.map_err(|e| e.error)
|
||||
.context("Wrong gossip topic header")?;
|
||||
|
||||
let topic = TopicId::from_bytes(topic_raw);
|
||||
insert_topic_stub(context, *msg_id, topic).await?;
|
||||
} else {
|
||||
warn!(context, "webxdc doesn't have a gossip topic")
|
||||
|
||||
Reference in New Issue
Block a user