pub struct Reaction {
reaction: String,
}
Expand description
A single reaction consisting of multiple emoji sequences.
It is guaranteed to have all emojis sorted and deduplicated inside.
Fields§
§reaction: String
Canonical representation of reaction as a string of space-separated emojis.
Implementations§
Trait Implementations§
source§impl From<&str> for Reaction
impl From<&str> for Reaction
source§fn from(reaction: &str) -> Self
fn from(reaction: &str) -> Self
Parses a string containing a reaction.
Reaction string is separated by spaces or tabs (WSP
in ABNF),
but this function accepts any ASCII whitespace, so even a CRLF at
the end of string is acceptable.
Any short enough string is accepted as a reaction to avoid the complexity of validating emoji sequences as required by RFC 9078. On the sender side UI is responsible to provide only valid emoji sequences via reaction picker. On the receiver side, abuse of the possibility to use arbitrary strings as reactions is not different from other kinds of spam attacks such as sending large numbers of large messages, and should be dealt with the same way, e.g. by blocking the user.