Called when a media message is received.
490561
def receive_message(self, message, data):
        
        if data[MESSAGE_TYPE] == TYPE_STATUS:
            self._process_status(data.get("data"))
            return True

        return False
207764
@Override
    public void onReceive(Context context, Intent notification) {
        GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
        String messageType = gcm.getMessageType(notification);
        Bundle extras = notification.getExtras();

        if (!extras.isEmpty() && GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
            showNotification(context, extras);
        }
    }
1201430
def _callback(self, ch, method, properties, body):
        """"""

        get_logger().info("Message received! Calling listeners...")

        topic = method.routing_key
        dct = json.loads(body.decode('utf-8'))

        for listener in self.listeners:
            listener(self, topic, dct)
546904
private void onMessageDelivered(MessageDeliveredEvent event) {
        handler.post(() -> listener.onMessageDelivered(event));
        log("Event published " + event.toString());
    }
1227594
@Override
  public void onNotificationMessageArrived(Context context, com.xiaomi.mipush.sdk.MiPushMessage miPushMessage) {
    if (null != miPushMessage) {
      String content = miPushMessage.getContent();
      if (!StringUtil.isEmpty(content)) {
        AndroidNotificationManager androidNotificationManager = AndroidNotificationManager.getInstance();
        androidNotificationManager.porcessMixNotificationArrived(content, AV_MIXPUSH_MI_NOTIFICATION_ARRIVED_ACTION);
      }
    }
  }
173714
public void processThisMessage()
    {
        Utility.getLogger().info("On message called in receiving process");
        try {
            BaseMessage messageIn = this.getMessage();
            if (messageIn != null)
            {
                BaseMessage messageReply = this.createReplyMessage(messageIn);
                this.moveScreenParamsToMessage(messageReply);
                // Step 2 - Get the body part of the message
                this.getTransport().setupReplyMessage(messageReply, messageIn, MessageInfoTypeModel.REPLY, MessageTypeModel.MESSAGE_IN);
            
                this.getTransport().processIncomingMessage(messageReply, null);
            }
        } catch(Exception ex) {
            ex.printStackTrace();
            Debug.print(ex, "Error in processing or replying to a message");
        }
    }
50693
@Override
  public void onNotificationMessageClicked(Context context, com.xiaomi.mipush.sdk.MiPushMessage miPushMessage) {
    processMiNotification(miPushMessage);
  }
1041580
def receive_message(self, msg):
        """"""
        _LOGGER.debug('Starting Device.receive_message')
        if hasattr(msg, 'isack') and msg.isack:
            _LOGGER.debug('Got Message ACK')
            if self._sent_msg_wait_for_directACK.get('callback') is not None:
                _LOGGER.debug('Look for direct ACK')
                asyncio.ensure_future(self._wait_for_direct_ACK(),
                                      loop=self._plm.loop)
            else:
                _LOGGER.debug('DA queue: %s',
                              self._sent_msg_wait_for_directACK)
                _LOGGER.debug('Message ACK with no callback')
        if (hasattr(msg, 'flags') and
                hasattr(msg.flags, 'isDirectACK') and
                msg.flags.isDirectACK):
            _LOGGER.debug('Got Direct ACK message')
            if self._send_msg_lock.locked():
                self._directACK_received_queue.put_nowait(msg)
            else:
                _LOGGER.debug('But Direct ACK not expected')
        if not self._is_duplicate(msg):
            callbacks = self._message_callbacks.get_callbacks_from_message(msg)
            for callback in callbacks:
                _LOGGER.debug('Scheduling msg callback: %s', callback)
                self._plm.loop.call_soon(callback, msg)
        else:
            _LOGGER.debug('msg is duplicate')
            _LOGGER.debug(msg)
        self._last_communication_received = datetime.datetime.now()
        _LOGGER.debug('Ending Device.receive_message')
1144908
def _message_callback(self, msg):
        """"""
        if msg.type == 'polytouch':
            button = button_from_press(msg.note)
            if button:
                self.on_button(button, msg.value != 0)
            elif msg.note == 127:
                self.on_fader_touch(msg.value != 0)
        elif msg.type == 'control_change' and msg.control == 0:
            self._msb = msg.value
        elif msg.type == 'control_change' and msg.control == 32:
            self._fader = (self._msb << 7 | msg.value) >> 4
            self.on_fader(self._fader)
        elif msg.type == 'pitchwheel':
            self.on_rotary(1 if msg.pitch < 0 else -1)
        else:
            print('Unhandled:', msg)
25636
async def _on_message(self, update):
        """"""

        name = update['service']
        message_obj = update['payload']

        if name not in self.services:
            return

        with self._state_lock:
            self.services[name].post_message(message_obj['level'], message_obj['message'])
1035156
def received_message(self, m):
        """"""

        # TODO: No support for binary messages
        m = str(m)
        logger.debug("Incoming upstream WS: %s", m)
        uwsgi.websocket_send(m)
        logger.debug("Send ok")
641530
function onBytesMessage(peer,data)
    {
        var arr = bufferToArray(scope._servConn.byteType,data);

        if(arr)
        {
            if(scope._servConn.rtcFallback == true)
            {
                arr = arr.slice(0,arr.length-2);
            }
            scope.dispatchEvent("peerMessage",{message:arr,id:peer.id,rtc:peer.rtcId,array:true,fallback:false});
        }
    }
1011970
def on_message(self, client, userdata, msg):
        
        if msg is None:
            return

        self.log_info("New message on topic {}".format(msg.topic))
        self.log_debug("Payload {}".format(msg.payload))

        if msg.payload is None or len(msg.payload) == 0:
            pass

        if msg.payload:
            payload = json.loads(msg.payload.decode('utf-8'))
            site_id = payload.get('siteId')
            session_id = payload.get('sessionId')

        if msg.topic is not None and msg.topic.startswith(MQTT_TOPIC_INTENT) and msg.payload:
            payload = json.loads(msg.payload.decode('utf-8'))
            intent = IntentParser.parse(payload, self.registry.intent_classes)
            self.log_debug("Parsed intent: {}".format(intent))
            if self.handle_intent is not None:
                if intent is not None:
                    self.log_debug("New intent: {}".format(str(intent.intentName)))
                self.handle_intent(intent, payload)
        elif msg.topic is not None and msg.topic == MQTT_TOPIC_HOTWORD + "toggleOn":
            self.state_handler.set_state(State.hotword_toggle_on)
        elif MQTT_TOPIC_HOTWORD_DETECTED_RE.match(msg.topic):
            if not self.first_hotword_detected:
                self.client.publish(
                    "hermes/feedback/sound/toggleOff", payload=None, qos=0, retain=False)
                self.first_hotword_detected = True
            self.state_handler.set_state(State.hotword_detected)
            if self.handle_start_listening is not None:
                self.handle_start_listening()
        elif msg.topic == MQTT_TOPIC_ASR + "startListening":
            self.state_handler.set_state(State.asr_start_listening)
        elif msg.topic == MQTT_TOPIC_ASR + "textCaptured":
            self.state_handler.set_state(State.asr_text_captured)
            if msg.payload is not None:
                self.log_debug("Text captured: {}".format(str(msg.payload)))
            if self.handle_done_listening is not None:
                self.handle_done_listening()
            payload = json.loads(msg.payload.decode('utf-8'))
            if payload['text'] == '':
                self.handle_intent(None, None)
        elif msg.topic is not None and msg.topic == "hermes/nlu/intentNotRecognized":
            self.handle_intent(None, None)
        elif msg.topic == "snipsmanager/setSnipsfile" and msg.payload:
            self.state_handler.set_state(State.asr_text_captured)
        elif msg.topic == MQTT_TOPIC_SESSION_STARTED:
            self.state_handler.set_state(State.session_started)
            if self.handlers_dialogue_events is not None:
                self.handlers_dialogue_events(self.DIALOGUE_EVENT_STARTED, session_id, site_id)
        elif msg.topic == MQTT_TOPIC_SESSION_ENDED:
            self.state_handler.set_state(State.session_ended)
            if self.handlers_dialogue_events is not None:
                self.handlers_dialogue_events(self.DIALOGUE_EVENT_ENDED, session_id, site_id)
        elif msg.topic == MQTT_TOPIC_SESSION_QUEUED:
            self.state_handler.set_state(State.session_queued)
            if self.handlers_dialogue_events is not None:
                self.handlers_dialogue_events(self.DIALOGUE_EVENT_QUEUED, session_id, site_id)
373621
def on_message(self, ws, reply, *args):
        
        log.debug("Received message: %s" % str(reply))
        data = {}
        try:
            data = json.loads(reply, strict=False)
        except ValueError:
            raise ValueError("API node returned invalid format. Expected JSON!")

        if data.get("method") == "notice":
            id = data["params"][0]

            if id >= len(self.__events__):
                log.critical("Received an id that is out of range\n\n" + str(data))
                return

            # This is a "general" object change notification
            if id == self.__events__.index("on_object"):
                # Let's see if a specific object has changed
                for notice in data["params"][1]:
                    try:
                        if "id" in notice:
                            self.process_notice(notice)
                        else:
                            for obj in notice:
                                if "id" in obj:
                                    self.process_notice(obj)
                    except Exception as e:
                        log.critical(
                            "Error in process_notice: {}\n\n{}".format(
                                str(e), traceback.format_exc
                            )
                        )
            else:
                try:
                    callbackname = self.__events__[id]
                    log.info("Patching through to call %s" % callbackname)
                    [getattr(self.events, callbackname)(x) for x in data["params"][1]]
                except Exception as e:
                    log.critical(
                        "Error in {}: {}\n\n{}".format(
                            callbackname, str(e), traceback.format_exc()
                        )
                    )
8701
def listen(self):
        """"""
        while True:
            message = self.pull.recv()
            logger.debug("received message of length %d" % len(message))
            uuid, message = message[:32], message[32:]
            response = uuid + self.handle(message)
            self.push.send(response)
1137171
def on_pubmsg(self, connection, event):
        
        sender = self.get_nick(event.source)
        channel = event.target
        message = event.arguments[0]

        self.handle_message(connection, sender, channel, message)
390297
def messageReceived(self, message):
        
        if len(message) == 2:
            # compatibility receiving of tag as first part
            # of multi-part message
            self.gotMessage(message[1], message[0])
        else:
            self.gotMessage(*reversed(message[0].split(b'\0', 1)))