Delivers a tell notification to the specified target player. It is assumed that the message
is coming from some server entity and need not be permissions checked or notified of the
result.
436218
public void deliverTell (BodyObject target, UserMessage message)
    {
        SpeakUtil.sendMessage(target, message);

        // note that the teller "heard" what they said
        SpeakUtil.noteMessage(target, message.speaker, message);
    }
764225
def open_notified_class
      class_eval do
        prepend NotificationActions
        attr_accessor :message, :notify_flag

        # Define association for the notified model
        has_many :notifications, class_name: 'SimpleNotifications::Record', as: :entity
        has_many :notifiers, through: :notifications, source: :sender, source_type: sender_class(@@options[:sender]).to_s
        has_many :read_deliveries, through: :notifications, source: :read_deliveries
        has_many :unread_deliveries, through: :notifications, source: :unread_deliveries

        # Callbacks
        after_create_commit :create_notification, if: proc {@@options[:callbacks].include?(:create)}
        after_update_commit :update_notification, if: proc {@@options[:callbacks].include?(:update)}
        after_destroy_commit :destroy_notification, if: proc {@@options[:callbacks].include?(:destroy)}

        NotificationActions.module_eval do
          @@options[:actions].each do |action|
            define_method(action) do
              run_callbacks action do
                super()
              end
            end

            define_method("before_#{action}".to_sym) do
            end

            define_method("after_#{action}".to_sym) do
              self.notify(sender: @@options[:sender], receivers: @@options[:receivers], message: default_message(self, @@options[:sender], action.to_s))
            end
          end
        end

        @@options[:actions].each do |action|
          define_model_callbacks action
          send("before_#{action}", "before_#{action}".to_sym)
          send("after_#{action}", "after_#{action}".to_sym)
        end

        #Example
        #post.notify(sender: :author, receivers: :followers, message: 'My Custom logic message')
        #post.create(content: '', notify: false) -> It does not create the notification.
        def notify(options = {})
          options[:sender] ||= @@options[:sender]
          options[:receivers] ||= @@options[:receivers]
          if notify_flag.nil? || (!notify_flag.nil? && !!notify_flag)
            raise 'SimpleNotification::SenderReceiverError' unless @@options[:sender] && @@options[:receivers]
            @message = options[:message] if options[:message]
            notification = notifications.build(entity: self, sender: get_obj(options[:sender]), message: default_message(self, get_obj(options[:sender]), 'created'))
            get_obj(options[:receivers]).each {|receiver| notification.deliveries.build(receiver: receiver)}
            notification.save
          end
        end

        def flush_notifications
          notifications.destroy_all
        end

        # Check if notifications has already been delivered.
        def notified?
          !notifications.blank?
        end

        def notificants
          SimpleNotifications::Record.includes(deliveries: :receiver)
              .collect(&:deliveries).flatten
              .collect(&:receiver)
        end

        def read_marked_notificants
          SimpleNotifications::Record.includes(deliveries: :receiver)
              .collect(&:deliveries).flatten
              .select{|record| record.is_read}
              .collect(&:receiver)
        end

        def unread_marked_notificants
          SimpleNotifications::Record.includes(deliveries: :receiver)
              .collect(&:deliveries).flatten
              .select{|record| !record.is_read}.collect(&:receiver)
        end

        # Mark notifications in read mode.
        # If notificants are provided then only those respective notifications will be marked read.
        # Else all will be marked as read.
        def mark_read(notificants = nil)
          (notificants ? unread_deliveries.where(receiver: notificants) : unread_deliveries).update_all(is_read: true)
        end

        # Mark notifications in unread mode.
        # If notificants are provided then only those respective notifications will be marked unread.
        # Else all will be marked as unread.
        def mark_unread(notificants = nil)
          (notificants ? read_deliveries.where(receiver: notificants) : read_deliveries).update_all(is_read: false)
        end

        def default_message(entity, sender, action)
          @message || (method(@@options[:notify_message]).call if !!@@options[:notify_message]) || "#{get_obj(sender).class.name} #{action} #{entity.class.name} #{entity.name}."
        end

        private

        def get_obj(sender_or_receivers)
          sender_or_receivers.kind_of?(Symbol) ? send(sender_or_receivers) : sender_or_receivers
        end

        def create_notification
          notify({sender: get_obj(@@options[:sender]), receivers: get_obj(@@options[:receivers]), message: default_message(self, get_obj(@@options[:sender]), 'created')})
        end

        def update_notification
          notify({sender: get_obj(@@options[:sender]), receivers: get_obj(@@options[:receivers]), message: default_message(self, get_obj(@@options[:sender]), 'updated')})
        end

        def destroy_notification
          notify({sender: get_obj(@@options[:sender]), receivers: get_obj(@@options[:receivers]), message: default_message(self, get_obj(@@options[:sender]), 'deleted')})
        end
      end
    end
344984
@Override
    public void emit(Level level, String message, long sequence) {
        if (_broadcaster != null) _broadcaster.sendNotification(new Notification(
            level.toString(),
            _name != null ? _name : this,
            sequence,
            message
        ));
    }
427731
function (status) {
                if  (anouncementIds.length > 0 && anouncementIds.indexOf(that.getCurrentPlaylistId()) < 0)
                {
                  //The item after the announcement has starting buffering -> restore original volume if required
                  if (urlOptions && urlOptions.volume) {
                    that._client.setVolumePromise(currentVolume);
                    urlOptions = undefined; //So we not set it again on every status update
                  }

                  if (that.getStatus().playerState != "BUFFERING") {
                    //The item after the announcement has starting playing -> remove announcement from list
                    log.info ("%s - Resumed after announcement", that._name);
                    that.removeFromPlaylistPromise(anouncementIds);
                    anouncementIds = [];
                    //Anouncement ended
                    return resolve(url);
                  }

                }

                if
                (
                  anouncementIds.length === 0 /*Already completed announcement*/ &&
                  (
                    //Did we insert a chunk?
                    chunkItemIds.length === 0 ||
                    //Next item started playing ?
                    (nextItem && that.getCurrentPlaylistId() == nextItem.itemId && that.getStatus().playerState != "BUFFERING")
                  )
                )
                {
                  //The remaining current item we just inserted has starting playing -> remove
                  log.info ("%s - Back to regular playlist", that._name);
                  if (chunkItemIds.length > 0)
                    that.removeFromPlaylistPromise(chunkItemIds);

                  //We are done
                  that.removeListener(that.EVENT_STATUS, resumeAfterAnnouncement);
                  return;
                }

                //Sanity check - if all items disapear then this means that a new playlist was loaded
                let idsToCheck=anouncementIds.concat(chunkItemIds);
                let allGone = true;

                for (let i in idsToCheck) {
                  if (that._playlist.getItemWithId(idsToCheck[i]) != undefined)
                    allGone = false;
                    break;
                }
                if (allGone) {
                  log.warn("%s - remaining item to play after announcement not found in the playlist -> remove status handled", that._name);
                  that.removeListener(that.EVENT_STATUS, resumeAfterAnnouncement);
                  log.debug("%s - Player status:\n%s",that._name, util.inspect(that._status,{depth:null, colors:true}))
                }

                //Not the status update we are waiting for
              }
1163812
public static void sendNotification (
        ClientObject target, String receiverCode, int methodId, Object[] args)
    {
        sendNotification(target, receiverCode, methodId, args, Transport.DEFAULT);
    }
862217
private void deliverAlbumArtUpdate(int player, AlbumArt art) {
        if (!getAlbumArtListeners().isEmpty()) {
            final AlbumArtUpdate update = new AlbumArtUpdate(player, art);
            for (final AlbumArtListener listener : getAlbumArtListeners()) {
                try {
                    listener.albumArtChanged(update);

                } catch (Throwable t) {
                    logger.warn("Problem delivering album art update to listener", t);
                }
            }
        }
    }
800837
def send_notify(self, playingsong, content=''):
        ''''''
        title = playingsong['title'].decode('utf-8')
        content = content.decode('utf-8')
        if title == self.title:
            if self.has_cover:
                send_notification(self.title, content, self.cover_file.name)
            else:
                send_notification(self.title, content)
        else:
            self.init_notification(playingsong)
            self.title = title
640231
def emit(self, action, event):
        
        NotificationManager.instance().emit(action, event, project_id=self.id)
896218
def notify(self, method, params=None):
        
        log.debug('Sending notification: %s %s', method, params)

        message = {
            'jsonrpc': JSONRPC_VERSION,
            'method': method,
        }
        if params is not None:
            message['params'] = params

        self._consumer(message)
1178914
def receive(self, data):
        
        self.log_debug("Received: %s" % (data))
        message =  self.make_message(data)
        self.trigger("receive", data=data, message=message)
        return message
1139138
def deliver_hook(target, payload, instance_id=None, hook_id=None, **kwargs):
    
    r = requests.post(
        url=target,
        data=json.dumps(payload),
        headers={
            "Content-Type": "application/json",
            "Authorization": "Token %s" % settings.HOOK_AUTH_TOKEN,
        },
    )
    r.raise_for_status()
    return r.text
912560
def _deliver_message(self, msg):
        
        my_subscribed_actions = self.subscriptions.get(msg.sender, [])
        for action in my_subscribed_actions:
            if Global.CONFIG_MANAGER.tracing_mode:
                Global.LOGGER.debug(f"delivering message to {action.name}")
            action.on_input_received(msg)
402211
def __notify(self, sender, content):
        
        if self.handle_message is not None:
            try:
                self.handle_message(sender, content)
            except Exception as ex:
                logging.exception("Error calling message listener: %s", ex)
681734
def broadcast(content)
      message = {
        id: SecureRandom.uuid,
        content: content
      }

      send_message('MSG_BROADCAST', message)
    end
932188
@Override
    public void sendSilenceMessage(
                                   long startStamp,
                                   long endStamp,
                                   long completedPrefix,
                                   boolean requestedOnly,
                                   int priority,
                                   Reliability reliability,
                                   SIBUuid12 stream)
    {
        // NOP, the PubSubInputHandler doesn't originate
        // silence.  The associated output handlers do it
        // for us.
    }
1046509
def notification_message(cls, item):
        ''''''
        assert isinstance(item, Notification)
        return cls.encode_payload(cls.request_payload(item, None))
195535
private void deliverTrackMetadataUpdate(int player, TrackMetadata metadata) {
        if (!getTrackMetadataListeners().isEmpty()) {
            final TrackMetadataUpdate update = new TrackMetadataUpdate(player, metadata);
            for (final TrackMetadataListener listener : getTrackMetadataListeners()) {
                try {
                    listener.metadataChanged(update);

                } catch (Throwable t) {
                    logger.warn("Problem delivering track metadata update to listener", t);
                }
            }
        }
    }