mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 15:06:30 +03:00
fix: Don't send webxdc notification for notify: "*" when chat is muted (#7658)
- webxdc notify specifically to Bob: notifies Bob even when chat is
muted
- webxdc notify to everyone ("*"): notifies Bob if he does not have the
chat muted
This aligns with how we handle notifications with quote replies.
---------
Co-authored-by: link2xt <link2xt@testrun.org>
This commit is contained in:
committed by
GitHub
parent
25750de4e1
commit
516f0a1a98
@@ -411,8 +411,16 @@ impl Context {
|
||||
&& let Some(notify_list) = status_update_item.notify
|
||||
{
|
||||
let self_addr = instance.get_webxdc_self_addr(self).await?;
|
||||
if let Some(notify_text) = notify_list.get(&self_addr).or_else(|| notify_list.get("*"))
|
||||
let notify_text = if let Some(notify_text) = notify_list.get(&self_addr) {
|
||||
Some(notify_text)
|
||||
} else if let Some(notify_text) = notify_list.get("*")
|
||||
&& !Chat::load_from_db(self, instance.chat_id).await?.is_muted()
|
||||
{
|
||||
Some(notify_text)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
if let Some(notify_text) = notify_text {
|
||||
self.emit_event(EventType::IncomingWebxdcNotify {
|
||||
chat_id: instance.chat_id,
|
||||
contact_id: from_id,
|
||||
|
||||
Reference in New Issue
Block a user