mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 20:56:49 +00:00
feat(sync): Add MSC4354 sticky events
This commit is contained in:
1 parent
7789399ba5
commit
43197f695c
25 files changed
+572
-18
No files matched your search
+11
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user