feat(sync): Add MSC4354 sticky events

This commit is contained in:
Erwan Leboucher authored and Ellis Git committed 2026-08-02 17:28:00 +00:00
1 parent 7789399ba5
commit 43197f695c
25 files changed
+572 -18

No files matched your search

+11 -1
View File
@@ -1,7 +1,11 @@
use std::collections::BTreeMap;
use axum::extract::State;
use conduwuit::{Err, Result, err, matrix::pdu::PartialPdu, utils};
use conduwuit::{
Err, Result, err,
matrix::pdu::{PartialPdu, sticky},
utils,
};
use ruma::{api::client::message::send_message_event, events::MessageLikeEventType};
use serde_json::from_str;
@@ -81,6 +85,12 @@ pub(crate) async fn send_message_event_route(
PartialPdu {
event_type: body.event_type.clone().into(),
content,
sticky: services
.config
.allow_sticky_events
.then_some(body.sticky_duration_ms)
.flatten()
.map(sticky::object),
unsigned: Some(unsigned),
timestamp: if body.identity.is_appservice() {
body.timestamp