Message and message_correct::Replace now has typed Id

This commit is contained in:
xmppftw xmppftw 2024-12-21 00:10:13 +01:00 committed by pep
commit 33098e6f2c
9 changed files with 45 additions and 32 deletions

View file

@ -36,7 +36,7 @@ pub async fn handle_message_chat(
let event = if let Some(correction) = correction {
Event::RoomPrivateMessageCorrection(
Some(correction.id),
correction.id,
full_from.to_bare(),
RoomNick::from_resource_ref(full_from.resource()),
body.clone(),
@ -56,14 +56,9 @@ pub async fn handle_message_chat(
} else {
let event = if let Some(correction) = correction {
// TODO: Check that correction is valid (only for last N minutes or last N messages)
Event::ChatMessageCorrection(
Some(correction.id),
from.to_bare(),
body.clone(),
time_info,
)
Event::ChatMessageCorrection(correction.id, from.to_bare(), body.clone(), time_info)
} else {
Event::ChatMessage(message.id.clone(), from.to_bare(), body.clone(), time_info)
Event::ChatMessage(message.id.clone(), from.to_bare(), body, time_info)
};
events.push(event);
}

View file

@ -59,7 +59,7 @@ pub async fn handle_message_group_chat(
let event = if let Some(correction) = correction {
Event::RoomMessageCorrection(
Some(correction.id),
correction.id,
from.to_bare(),
RoomNick::from_resource_ref(resource),
body.clone(),