Send Markdown Message with mentions

@param peer        destination peer
@param name        contact name
@param phones      contact phones
@param emails      contact emails
@param base64photo contact photo
963567
@ObjectiveCName("sendContactWithPeer:withName:withPhones:withEmails:withPhoto:")
    public void sendContact(@NotNull Peer peer, @NotNull String name, @NotNull ArrayList<String> phones,
                            @NotNull ArrayList<String> emails, @Nullable String base64photo) {
        modules.getMessagesModule().sendContact(peer, name, phones, emails, base64photo);
    }
196167
public void send(PeerMessage message) throws IllegalStateException {
    logger.trace("Sending msg {} to {}", message.getType(), this);
    if (this.isConnected()) {
      ByteBuffer data = message.getData();
      data.rewind();
      connectionManager.offerWrite(new WriteTask(socketChannel, data, new WriteListener() {
        @Override
        public void onWriteFailed(String message, Throwable e) {
          if (e == null) {
            logger.info(message);
          } else if (e instanceof ConnectionClosedException){
            logger.debug(message, e);
            unbind(true);
          } else {
            LoggerUtils.warnAndDebugDetails(logger, message, e);
          }

        }

        @Override
        public void onWriteDone() {
        }
      }), 1, TimeUnit.SECONDS);
    } else {
      logger.trace("Attempting to send a message to non-connected peer {}!", this);
      unbind(true);
    }
  }
1224205
void broadcast(Iterator<String> peers, Message message) {
    transport.broadcast(peers, message);
  }
953409
private void sendOrPublishMessage(Message message) {
        if (endpointConfiguration.isPubSubDomain()) {
            if (log.isDebugEnabled()) {
                log.debug("Publish Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'");
            }
            vertx.eventBus().publish(endpointConfiguration.getAddress(), message.getPayload());
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Sending Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'");
            }
            vertx.eventBus().send(endpointConfiguration.getAddress(), message.getPayload());
        }
    }
23372
public void broadcastMessageToTopic(String dest, String requestMessage) {
        jmsTopicTemplate.setDeliveryPersistent(true);

        jmsTopicTemplate.send(dest, new MDWMessageCreator(requestMessage));
    }
196648
function sendMessage(ws, type, content) {
	var message = JSON.stringify([type, content]);
	if (ws.readyState !== ws.OPEN)
		return console.log("readyState="+ws.readyState+' on peer '+ws.peer+', will not send '+message);
	console.log("SENDING "+message+" to "+ws.peer);
	if (typeof window !== 'undefined' && window && window.cordova) {
		ws.send(message);
	} else {
		ws.send(message, function(err){
			if (err)
				ws.emit('error', 'From send: '+err);
		});
	}
}
628747
function sendMessage(text, attachmentFileId) {
    stickerpipe.onUserMessageSent(stickerpipe.isSticker(text));

    var msg = {
        type: currentDialog.type === 3 ? 'chat' : 'groupchat',
        body: text,
        extension: {
            save_to_history: 1,
        },
        markable: 1
    };

    if(attachmentFileId !== null){
        msg['extension']['attachments'] = [{id: attachmentFileId, type: 'photo'}];
    }

    if (currentDialog.type === 3) {
        opponentId = QB.chat.helpers.getRecipientId(currentDialog.occupants_ids, currentUser.id);

        QB.chat.send(opponentId, msg);

        $('.list-group-item.active .list-group-item-text')
            .text(stickerpipe.isSticker(msg.body) ? 'Sticker' : msg.body);

        if(attachmentFileId === null){
            showMessage(currentUser.id, msg);
        } else {
            showMessage(currentUser.id, msg, attachmentFileId);
        }
    } else {
        QB.chat.send(currentDialog.xmpp_room_jid, msg);
    }

    // claer timer and send 'stop typing' status
    clearTimeout(isTypingTimerId);
    isTypingTimeoutCallback();

    dialogsMessages.push(msg);
}
172028
@OnMessage("/socket/{name}")
    public void messageOnSeveralSockets(@Parameter("name") String name, @Body String message) {
        logger().info("Message received on {} : {}", name, message);
    }
1238940
function(peer) {
			if (this.peers[peer.id]) {
				// Update
				this.peers[peer.id] = peer;
			} else {
				// Add
				this.peers[peer.id] = peer;
			}
			if (this.collabHasFileAnnotation(peer.id)) {
				var annotation = this.getCollabFileAnnotation(peer.id);
				this.addOrUpdateCollabFileAnnotation(peer.id, contextPath, annotation.location);
			}
			if (this.otOrionAdapter && this.textView) {
				// Make sure we have view installed
				this.otOrionAdapter.updateLineAnnotationStyle(peer.id);
			}
		}
1306248
public Contact sendContact(final ContactRequest contactRequest) throws UnauthorizedException, GeneralException {
        return messageBirdService.sendPayLoad(CONTACTPATH, contactRequest, Contact.class);
    }
473327
@ObjectiveCName("deleteMessagesWithPeer:withRids:")
    public void deleteMessages(Peer peer, long[] rids) {
        modules.getMessagesModule().deleteMessages(peer, rids);
    }
17914
int sendMessageToTopicForSessions(Collection<Session> sessions, MessageToClient mtc, Object payload) {
		int sended = 0;
		JsTopicMessageController msgControl = messageControllerManager.getJsTopicMessageController(mtc.getId());
		Collection<Session> sessionsClosed = new ArrayList<>();
		for (Session session : sessions) {
			try {
				sended += checkAndSendMtcToSession(session, msgControl, mtc, payload);
			} catch (SessionException se) {
				sessionsClosed.add(se.getSession());
			}
		}
		if (logger.isDebugEnabled()) {
			logger.debug("Send message to '{}' topic {} client(s) : {}", new Object[]{mtc.getId(), sessions.size() - sessionsClosed.size(), mtc});
		}
		topicManager.removeSessionsToTopic(sessionsClosed);
		return sended;
	}
532059
public static void sendHtml(Collection<String> tos, String subject, String content, File... files) {
		send(tos, subject, content, true, files);
	}
688033
public void broadcast(Iterator<String> peers, Message message) {
    while (peers.hasNext()) {
      send(peers.next(), message);
    }
  }
249281
public void sendHtmlMail(String from, String[] to, String title, String text)
            throws AddressException, MessagingException {

        long start = System.currentTimeMillis();

        MimeMessage mimeMessage = mailSender.createMimeMessage();
        MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, true, "GBK");

        InternetAddress[] toArray = new InternetAddress[to.length];
        for (int i = 0; i < to.length; i++) {
            toArray[i] = new InternetAddress(to[i]);
        }

        messageHelper.setFrom(new InternetAddress(from));
        messageHelper.setTo(toArray);
        messageHelper.setSubject(title);
        messageHelper.setText(text, true);
        mimeMessage = messageHelper.getMimeMessage();
        mailSender.send(mimeMessage);
        long end = System.currentTimeMillis();
        LOG.info("send mail start:" + start + " end :" + end);
    }
209817
public void sendDownTree(SIBUuid8[] targets, int priority, AbstractMessage cMsg)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "sendDownTree", new Object[] { this, cMsg, Integer.valueOf(priority), targets});
  
    // Select a set of connections, then annotate the message.
    int length  = targets.length;
    //the unique list of connections
    MPConnection[] send = new MPConnection[length];
    int[] cCount = new int[length];
    int numSendConnections = 0;
    
    next:
    for(int i=0; i<length; i++)
    {
      SIBUuid8 targetMEUuid = targets[i];
      MPConnection firstChoice = findMPConnection(targetMEUuid);
      
      // Minimal comms trace of the message we're trying to send
      if (TraceComponent.isAnyTracingEnabled()) {
        MECommsTrc.traceMessage(tc, 
            _messageProcessor, 
            cMsg.getGuaranteedTargetMessagingEngineUUID(), 
            MECommsTrc.OP_SEND, 
            firstChoice, 
            cMsg);
      }
      
      if(firstChoice != null)
      {
        // Keep track of the set of unique connections for sending below
        int j = 0;
        //loop through send until we find the next unused slot
        for(j=0; (j<i) && (send[j]!=null); j++)
        {          
          //if we have seen the selected connection before, start again
          if (send[j].equals(firstChoice))
          {                        
            cCount[j]++;
            continue next;
          }
        }
        if(j+1 > numSendConnections) numSendConnections = (j+1);
        //store the select connection in the chosen send slot
        send[j] = firstChoice;
        cCount[j]++;
      }
    }
  
    for(int i=0; i<numSendConnections; i++)
    {
      if (send[i] != null) send[i].send(cMsg,priority);
    }
  
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "sendDownTree");
  }
486311
public void sendJsonToTagged(Object data, String ... labels) {
        for (String label : labels) {
            sendJsonToTagged(data, label);
        }
    }