Signal notification fixes and UI updates
This commit is contained in:
parent
d93797172a
commit
59872f579a
11 changed files with 440 additions and 201 deletions
|
|
@ -91,9 +91,8 @@ class Transaction::SignalNotification
|
|||
possible_recipients_with_ooo.each do |user|
|
||||
next if recipient_is_current_user?(user)
|
||||
next if !user.active?
|
||||
next if !user_has_signal_notifications_enabled?(user)
|
||||
next if user.signal_uid.blank?
|
||||
next if !should_notify_for_event?(user)
|
||||
next if user_signal_uid(user).blank?
|
||||
next if !user_wants_signal_for_event?(user)
|
||||
|
||||
recipients.push(user)
|
||||
end
|
||||
|
|
@ -123,11 +122,11 @@ class Transaction::SignalNotification
|
|||
false
|
||||
end
|
||||
|
||||
def user_has_signal_notifications_enabled?(user)
|
||||
user.preferences.dig('signal_notifications', 'enabled') == true
|
||||
def user_signal_uid(user)
|
||||
user.preferences.dig('notification_config', 'signal_uid').presence
|
||||
end
|
||||
|
||||
def should_notify_for_event?(user)
|
||||
def user_wants_signal_for_event?(user)
|
||||
event_type = @item[:type]
|
||||
return false if event_type.blank?
|
||||
|
||||
|
|
@ -139,6 +138,6 @@ class Transaction::SignalNotification
|
|||
else return false
|
||||
end
|
||||
|
||||
user.preferences.dig('signal_notifications', 'events', event_key) == true
|
||||
user.preferences.dig('notification_config', 'matrix', event_key, 'channel', 'signal') == true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue