push_messages.rb 505 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Subscriptions
  3. class PushMessages < BaseSubscription
  4. description 'Broadcast messages to all users'
  5. broadcastable true
  6. field :title, String, description: 'Message title'
  7. field :text, String, description: 'Message text'
  8. def self.authorize(...)
  9. true # This subscription should be available for all (including unauthenticated) users.
  10. end
  11. def update
  12. object
  13. end
  14. end
  15. end