helix-im 0.1.21

基于 Helix Core 的确定性 MessageV3 IM 业务模块
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! G-06 reaction 的单列确定性写模型。

use helix_core::effect::{BatchUpdateSpec, SqlValue, StorageOp};

/// 只覆盖服务端权威 quick_reply,避免 reaction 误写普通编辑或本地状态列。
pub fn message_v3_reaction_op(message_id: &str, quick_reply: String) -> StorageOp {
    StorageOp::BatchUpdate(BatchUpdateSpec {
        table: "message",
        key_col: "id",
        key_vals: vec![SqlValue::Text(message_id.to_string())],
        patch: vec![("quick_reply".to_string(), SqlValue::Text(quick_reply))],
    })
}