atagen

matrix-rust-sdk

public
Star0
Watch0

Commit 7667491c27f7

tarball

atagen <boss@atagen.co>2026-10-25 10:49 UTC

2 files changed+3-11
sdk: share the reaction shortcode field names

REACTION_SHORTCODE_FIELD and CINNY_REACTION_SHORTCODE_FIELD were defined in both the send queue and the timeline event handler, so the two writers and the reader could drift apart. matrix_sdk::send_queue now exports the pair and the timeline reuses it.
Modified file: crates/matrix-sdk-ui/src/timeline/event_handler.rs+1 additions−9 deletions
@@ -65,15 +65,7 @@ use crate::{
6565 unable_to_decrypt_hook::UtdHookManager,
6666 };
6767
68-/// The field holding the shortcode of a custom emote reaction, as per
69-/// [MSC4027], which ruma's `ReactionEventContent` has no field for.
70-///
71-/// [MSC4027]: https://github.com/matrix-org/matrix-spec-proposals/pull/4027
72-pub(super) const REACTION_SHORTCODE_FIELD: &str = "com.beeper.reaction.shortcode";
73-
74-/// The unprefixed shortcode field Cinny reads and writes instead of
75-/// [`REACTION_SHORTCODE_FIELD`].
76-pub(super) const CINNY_REACTION_SHORTCODE_FIELD: &str = "shortcode";
68+pub(super) use matrix_sdk::send_queue::{CINNY_REACTION_SHORTCODE_FIELD, REACTION_SHORTCODE_FIELD};
7769
7870 /// Reads the [MSC4027] shortcode from a reaction's raw content, falling back
7971 /// to the field Cinny uses.
Modified file: crates/matrix-sdk/src/send_queue/mod.rs+2 additions−2 deletions
@@ -3165,11 +3165,11 @@ fn canonicalize_dependent_requests(
31653165 /// The [MSC4027] field holding a custom emote reaction's shortcode.
31663166 ///
31673167 /// [MSC4027]: https://github.com/matrix-org/matrix-spec-proposals/pull/4027
3168-const REACTION_SHORTCODE_FIELD: &str = "com.beeper.reaction.shortcode";
3168+pub const REACTION_SHORTCODE_FIELD: &str = "com.beeper.reaction.shortcode";
31693169
31703170 /// The unprefixed shortcode field Cinny reads instead of
31713171 /// [`REACTION_SHORTCODE_FIELD`].
3172-const CINNY_REACTION_SHORTCODE_FIELD: &str = "shortcode";
3172+pub const CINNY_REACTION_SHORTCODE_FIELD: &str = "shortcode";
31733173
31743174 /// Adds the [MSC4027] shortcode of a custom emote to a reaction's content,
31753175 /// which ruma's [`ReactionEventContent`] has no field for.