Posts messages to brackets
@param {string} messageId - Message to be passed
968872
function postMessageToBrackets(messageId, requester) {
        if(!requesters[requester]) {
            for (var key in requesters) {
                requester = key;
                break;
            }
        }

        var msgObj = {
            fn: messageId,
            args: getFunctionArgs(arguments),
            requester: requester.toString()
        };
        _domainManager.emitEvent('AutoUpdate', 'data', [msgObj]);
    }
848670
function (msg) {
            var msgHandlers;
            if (!msg.method) {
                // no message type, ignoring it
                // TODO: should we trigger a generic event?
                console.log("[Brackets LiveDev] Received message without method.");
                return;
            }
            // get handlers for msg.method
            msgHandlers = this.handlers[msg.method];

            if (msgHandlers && msgHandlers.length > 0) {
                // invoke handlers with the received message
                msgHandlers.forEach(function (handler) {
                    try {
                        // TODO: check which context should be used to call handlers here.
                        handler(msg);
                        return;
                    } catch (e) {
                        console.log("[Brackets LiveDev] Error executing a handler for " + msg.method);
                        console.log(e.stack);
                        return;
                    }
                });
            } else {
                // no subscribers, ignore it.
                // TODO: any other default handling? (eg. specific respond, trigger as a generic event, etc.);
                console.log("[Brackets LiveDev] No subscribers for message " + msg.method);
                return;
            }
        }
1009481
function SingpostInfo(id, messages) {
    this.id = id
    this.states = messages
    this.trackerWebsite = singpost.getLink(null)
}
1225578
public void postMessage (Transport transport, String name, Object... args)
    {
        postEvent(new MessageEvent(_oid, name, args).setTransport(transport));
    }
131778
function sendTextMessage(recipientId, messageText) {
    var messageData = {
        recipient: {
            id: recipientId
        },
        message: {
            text: messageText
        }
    };
    callSendAPI(messageData);
}
1188151
function domElement(ids) {
        var selector = "";
        if (!Array.isArray(ids)) {
            ids = [ids];
        }
        _.each(ids, function (id) {
            if (selector !== "") {
                selector += ",";
            }
            selector += "[data-brackets-id='" + id + "']";
        });
        rule(selector);
    }
319696
function MessageFormatter() {
  this.format = format;
  function format(result) {
    _.each(result, function(message) {
      console.log(message);
    });
  }
}
437374
void processPubRel(String clientID, int messageID) {
        Log.trace("PUB --PUBREL--> SRV processPubRel invoked for clientID {} ad messageID {}", clientID, messageID);
        String publishKey = String.format("%s%d", clientID, messageID);
        PublishEvent evt = m_storageService.retrieveQoS2Message(publishKey);

        final String topic = evt.getTopic();
        final AbstractMessage.QOSType qos = evt.getQos();

        publish2Subscribers(topic, qos, evt.getMessage(), evt.isRetain(), evt.getMessageID());

        m_storageService.removeQoS2Message(publishKey);

        if (evt.isRetain()) {
            m_storageService.storeRetained(topic, evt.getMessage(), qos);
        }

        sendPubComp(clientID, messageID);
    }
1068145
function(threadId, pushMessageVO) {
                /**
                 * + MessageVO                       {object}
                 *    - id                           {long}
                 *    - threadId                     {long}
                 *    - ownerId                      {long}
                 *    - uniqueId                     {string}
                 *    - previousId                   {long}
                 *    - message                      {string}
                 *    - messageType                  {int}
                 *    - edited                       {boolean}
                 *    - editable                     {boolean}
                 *    - deletable                    {boolean}
                 *    - delivered                    {boolean}
                 *    - seen                         {boolean}
                 *    - participant                  {object : ParticipantVO}
                 *    - conversation                 {object : ConversationVO}
                 *    - replyInfo                    {object : replyInfoVO}
                 *    - forwardInfo                  {object : forwardInfoVO}
                 *    - metadata                     {string}
                 *    - systemMetadata               {string}
                 *    - time                         {long}
                 *    - timeNanos                    {long}
                 */

                var message = {
                    id: pushMessageVO.id,
                    threadId: threadId,
                    ownerId: (pushMessageVO.ownerId)
                        ? pushMessageVO.ownerId
                        : undefined,
                    uniqueId: pushMessageVO.uniqueId,
                    previousId: pushMessageVO.previousId,
                    message: pushMessageVO.message,
                    messageType: pushMessageVO.messageType,
                    edited: pushMessageVO.edited,
                    editable: pushMessageVO.editable,
                    deletable: pushMessageVO.deletable,
                    delivered: pushMessageVO.delivered,
                    seen: pushMessageVO.seen,
                    participant: undefined,
                    conversation: undefined,
                    replyInfo: undefined,
                    forwardInfo: undefined,
                    metadata: pushMessageVO.metadata,
                    systemMetadata: pushMessageVO.systemMetadata,
                    time: (pushMessageVO.timeNanos)
                        ? (parseInt(parseInt(pushMessageVO.time) / 1000) * 1000000000) + parseInt(pushMessageVO.timeNanos)
                        : (parseInt(pushMessageVO.time)),
                    timeMiliSeconds: parseInt(pushMessageVO.time),
                    timeNanos: parseInt(pushMessageVO.timeNanos)
                };

                if (pushMessageVO.participant) {
                    message.ownerId = pushMessageVO.participant.id;
                }

                if (pushMessageVO.conversation) {
                    message.conversation = formatDataToMakeConversation(pushMessageVO.conversation);
                    message.threadId = pushMessageVO.conversation.id;
                }

                if (pushMessageVO.replyInfoVO) {
                    message.replyInfo = formatDataToMakeReplyInfo(pushMessageVO.replyInfoVO, threadId);
                }

                if (pushMessageVO.forwardInfo) {
                    message.forwardInfo = formatDataToMakeForwardInfo(pushMessageVO.forwardInfo, threadId);
                }

                if (pushMessageVO.participant) {
                    message.participant = formatDataToMakeParticipant(pushMessageVO.participant, threadId);
                }

                return message;
            }
517353
private function remove_flag_from_message($messageid, $flag) {
        // Get the current mailbox.
        $mailbox = $this->get_mailbox();

        // Mark it as read to lock the message.
        $this->client->store($mailbox, array(
            'ids' => $messageid,
            'delete' => $flag,
        ));
    }
1355265
function messageResend(details, callback) {
        createsend.post('transactional/messages/'+details.messageID+'/resend', null, null, function(error, results) {
            txResponseCallback(error, results, callback);
        }, true);
    }
922944
public function setMessageId($messageId)
    {
        if (is_integer($messageId) || is_float($messageId)) {
            $this->messageId = $messageId;
        } else {
            throw new InvalidArgumentException();
        }
    }
609459
public function MarkMessageRead($messageId, $accessToken = null)
    {
        return $this->provider->executeRequest("POST", "/message/{$messageId}", $accessToken ?: $this->accessToken);
    }
521249
public boolean markSent(MessageID messageID) {
        MessageInfo messageInfo =  sentMessages.remove(messageID);
        return messageInfo != null && messageInfo.toSelfDeliver;
    }
356041
function onMessage(userId, msg) {
  // check if it's a message for current dialog
  if (isMessageForCurrentDialog(userId, msg.dialog_id)){
    console.log("Message for this dialog");

    dialogsMessages.push(msg);

    // read message if current dialog is on screen
    if (msg.markable === 1 && userId != currentUser.id) {
      sendReadStatus(userId, msg.id, msg.dialog_id);
    }

    // сheck if it's an attachment
    //
    var messageAttachmentFileId = null;
    if (msg.extension.hasOwnProperty("attachments")) {
      if(msg.extension.attachments.length > 0) {
        messageAttachmentFileId = msg.extension.attachments[0].id;
      }
    }

    showMessage(userId, msg, messageAttachmentFileId);
  }
  // Here we process the regular messages
  //
  updateDialogsList(msg.dialog_id, msg.body);
}
256799
def post_event(self, id, **data):
        
        
        return self.post("/events/{0}/".format(id), data=data)
612308
public function sendMessage($messageID) {
		// Check message, subject, and additional arguments to include
		list($subject, $message) = $this->generateMessageTemplate($messageID);
		if(empty($subject) || empty($message)) {
			$this->log("Skipping sending message. None configured for $messageID");
			return true;
		}

		// Save last sent message
		$this->LastMessageSent = $messageID;
		$this->write();

		// Setup messaging arguments
		$arguments = array_merge(
			$this->getConfigSetting('PipelineConfig', 'ServiceArguments') ?: array(),
			array('subject' => $subject)
		);

		// Send message to author
		if($author = $this->Author()) {
			$this->log("Pipeline sending $messageID message to {$author->Email}");
			$this->messagingService->sendMessage($this, $message, $author, $arguments);
		} else {
			$this->log("Skipping sending message to missing author");
		}

		// Get additional recipients
		$recipients = $this->getConfigSetting('PipelineConfig', 'Recipients', $messageID);
		if(empty($recipients)) {
			$this->log("Skipping sending message to empty recipients");
		} else {
			$recipientsStr = is_array($recipients) ? implode(',', $recipients) : $recipients;
			$this->log("Pipeline sending $messageID message to $recipientsStr");
			$this->messagingService->sendMessage($this, $message, $recipients, $arguments);
		}
	}