mirror of
https://github.com/chatmail/core.git
synced 2026-08-15 05:13:33 +03:00
fix: filtered reactions are info, not error in device chat
bail!() bubbles up the error until it lands in the device chat, which is way over the top for a reaction that is filtered out by channel owner. currently this happens, as arcance chat uses different default reactions. in the future, this may happen even more often when we allow custom filters, that may change over time.
This commit is contained in:
@@ -137,7 +137,8 @@ async fn set_msg_id_reaction(
|
||||
if matches!(chat.typ, Chattype::OutBroadcast | Chattype::InBroadcast)
|
||||
&& !is_allowed_reaction(reaction)
|
||||
{
|
||||
bail!("Reaction not allowed: {}", reaction.as_str());
|
||||
info!(context, "Reaction {} filtered.", reaction.as_str());
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if reaction.is_empty() {
|
||||
|
||||
@@ -174,6 +174,7 @@ async fn broadcast_reactions_for_one_chat(context: &Context, chat_id: ChatId) ->
|
||||
|
||||
/// Applies incoming, accumulated reactions received via the `Chat-Broadcast-States:` header
|
||||
/// to the `broadcasted_reactions` table.
|
||||
/// We do not check against allowed reactions here; reactions may be done in the past when different filters were active.
|
||||
pub(crate) async fn receive_broadcast_reactions(context: &Context, json: &str) -> Result<()> {
|
||||
let payload: WirePayload = serde_json::from_str(json)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user