Sha256: 4c1cefabf3772561c9c95d7a4e117d161234e787bc95d62a81901525b3834bbd

Contents?: true

Size: 695 Bytes

Versions: 16

Compression:

Stored size: 695 Bytes

Contents

module Marty
  module Notifications
    module Processors
      module Web
        class << self
          def call(delivery:)
            delivery.set_sent!
            notify_websocket(delivery: delivery)
          end

          private

          def notify_websocket(delivery:)
            return unless Rails.application.config.marty.enable_action_cable

            unread_notifications_count = delivery.recipient&.unread_web_notifications_count

            ActionCable.server.broadcast(
              "marty_notifications_#{delivery.recipient_id}",
              unread_notifications_count: unread_notifications_count
            )
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
marty-14.3.0 app/services/marty/notifications/processors/web.rb
marty-14.0.0 app/services/marty/notifications/processors/web.rb
marty-13.0.2 app/services/marty/notifications/processors/web.rb
marty-11.0.0 app/services/marty/notifications/processors/web.rb
marty-10.0.3 app/services/marty/notifications/processors/web.rb
marty-10.0.2 app/services/marty/notifications/processors/web.rb
marty-10.0.0 app/services/marty/notifications/processors/web.rb
marty-9.5.1 app/services/marty/notifications/processors/web.rb
marty-9.5.0 app/services/marty/notifications/processors/web.rb
marty-9.3.3 app/services/marty/notifications/processors/web.rb
marty-9.3.2 app/services/marty/notifications/processors/web.rb
marty-9.3.0 app/services/marty/notifications/processors/web.rb
marty-8.5.0 app/services/marty/notifications/processors/web.rb
marty-8.4.1 app/services/marty/notifications/processors/web.rb
marty-8.3.1 app/services/marty/notifications/processors/web.rb
marty-8.2.0 app/services/marty/notifications/processors/web.rb