parsers: port Message to use the derive macros

This commit is contained in:
Jonas Schäfer 2025-04-18 12:26:27 +02:00
commit 5172fb5e0f
11 changed files with 183 additions and 202 deletions

View file

@ -25,7 +25,7 @@ pub async fn handle_message_group_chat(
events.push(Event::RoomSubject(
from.to_bare(),
from.resource().map(RoomNick::from_resource_ref),
subject.0.clone(),
subject.clone(),
time_info.clone(),
));
found_subject = true;

View file

@ -7,7 +7,7 @@
use crate::{
jid::{BareJid, Jid},
minidom::Element,
parsers::message::{Body, Message, MessagePayload, MessageType},
parsers::message::{Message, MessagePayload, MessageType},
};
use crate::Agent;
@ -66,7 +66,7 @@ pub async fn send_raw_message<'a>(agent: &mut Agent, settings: RawMessageSetting
stanza.type_ = message_type;
stanza
.bodies
.insert(lang.unwrap_or("").to_string(), Body(String::from(message)));
.insert(lang.unwrap_or("").into(), String::from(message));
agent.client.send_stanza(stanza.into()).await.unwrap();
}