Skip to main content

apply_send

Function apply_send 

Source
pub fn apply_send(
    conn: &mut Connection,
    room: &Room,
    caller_user_id: i64,
    caller_mxid: &str,
    device_id: &str,
    txn_id: &str,
    event_id: &str,
    event_type: &str,
    content_str: &str,
    now: &str,
    origin_ts: i64,
) -> Result<SendOutcome, MatrixError>
Expand description

PUT /send/{eventType}/{txnId}’s whole DB-side decision + write (plan §4 send row): txn-dedup peek first (a repeat short-circuits everything else and returns the ORIGINAL event, per the idempotency rule); then Member, the type-refusal rule, PowerCheck(events[type] else events_default), the send-rate limits, and the m.replace-sender rule; then the dedup-checked insert itself.