Helper function for {@link #mogrifyChat(String,byte,boolean,boolean)}.
320457
protected StringBuffer mogrifyChat (
        StringBuffer buf, boolean transformsAllowed, boolean capFirst)
    {
        if (_mogrifyChat) {
            // do the generic mogrifications and translations
            buf = translatedReplacements("x.mogrifies", buf);

            // perform themed expansions and transformations
            if (transformsAllowed) {
                buf = translatedReplacements("x.transforms", buf);
            }
        }

        /*
        // capitalize the first letter
        if (capFirst) {
            buf.setCharAt(0, Character.toUpperCase(buf.charAt(0)));
        }
        // and capitalize any letters after a sentence-ending punctuation
        Pattern p = Pattern.compile("([^\\.][\\.\\?\\!](\\s)+\\p{Ll})");
        Matcher m = p.matcher(buf);
        if (m.find()) {
            buf = new StringBuilder();
            m.appendReplacement(buf, m.group().toUpperCase());
            while (m.find()) {
                m.appendReplacement(buf, m.group().toUpperCase());
            }
            m.appendTail(buf);
        }
        */

        return buf;
    }
1239718
@Override
  public void onMessage(WebSocket webSocket, ByteString bytes) {
    callback.onAudioStream(bytes.toByteArray());
  }
821464
public void pushChatGrabber (JTextComponent comp)
    {
        // note this component as the new chat grabber
        _curChatGrabber = comp;

        // add the component to the list of grabbers
        _chatGrabbers.addLast(comp);
        comp.addAncestorListener(this);

        // and request to give the new component the focus since that's a
        // sensible thing to do as it's aiming to nab all key events
        // henceforth
        comp.requestFocusInWindow();
    }
475894
@Override
    public void onBusEvent(Event event) {
        if (event instanceof AppVisibleChanged) {
            AppVisibleChanged visibleChanged = (AppVisibleChanged) event;
            if (visibleChanged.isVisible()) {
                onAppVisible();
            } else {
                onAppHidden();
            }
        } else if (event instanceof PeerChatOpened) {
            onConversationVisible(((PeerChatOpened) event).getPeer());
        } else if (event instanceof PeerChatClosed) {
            onConversationHidden(((PeerChatClosed) event).getPeer());
        }
    }
607511
public ChatMessage sendMessage(String text) {
        if (text != null && !text.isEmpty()) {
            ChatMessage message = new ChatMessage(self, text);
            eventManager.fireRemoteEvent(sendEvent, message);
            return message;
        }
        
        return null;
    }
481619
function(msg) {
        if (onSendLogging)
          asyncLogger("Send", msg);

        switch (protocol) {
          case 'websocket':
            if (socketState === socketStateType.OPEN) {
              socket.emit(msg);
            } else {
              pushSendDataQueue.push(msg);
            }
            break;

          case 'queue':
            if (socketState === socketStateType.OPEN) {
              activemq.sendMessage({
                destination: params.queueSend,
                message: msg
              });
            } else {
              pushSendDataQueue.push(msg);
            }
            break;
        }
      }
586591
public boolean addChatterObserver (ChatterObserver co)
    {
        boolean added = _chatterObservers.add(co);
        co.chattersUpdated(_chatters.listIterator());

        return added;
    }
837362
def chat_react(self, msg_id, emoji='smile', **kwargs):
        """"""
        return self.__call_api_post('chat.react', messageId=msg_id, emoji=emoji, kwargs=kwargs)
1065366
function(callback) {
  async.parallelAsync([
    tox.addGroupchat.bind(tox),
    tox.getAV().addGroupchat.bind(tox.getAV())
  ]).then(function(results) {
    groupchats['text'] = results[0];
    groupchats['av'] = results[1];
  }).finally(callback);
}
874415
public void onText (@Nullable final String sText, final boolean bEscape)
  {
    if (bEscape)
      _appendMasked (EXMLCharMode.TEXT, sText);
    else
      _append (sText);
  }
1008477
private void sendValidatedMessage()
    {
        final String msg = message.toString();
        if (canSendMessage(msg))
        {
            addNetworkMessage(new NetworkMessageChat(type, getClientId().byteValue(), msg));
        }
        message.delete(0, message.length());
    }
1365097
def sendChatAction(self, chat_id, action):
        
        p = _strip(locals())
        return self._api_request('sendChatAction', _rectify(p))
32821
def factory_chat(js_obj, driver=None):
    """"""
    if js_obj["kind"] not in ["chat", "group", "broadcast"]:
        raise AssertionError("Expected chat, group or broadcast object, got {0}".format(js_obj["kind"]))

    if js_obj["isGroup"]:
        return GroupChat(js_obj, driver)

    if js_obj["kind"] == "broadcast":
        return BroadcastChat(js_obj, driver)

    return UserChat(js_obj, driver)
1295782
function(params, callback) {
                chatSendQueue.push(params);
                putInChatWaitQueue(params.message, function() {
                    callback && callback();
                });
            }
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});
        }
    }
448041
function subscribeToChat () {
  console.tron.log('Subscribing to Chat')
  if (!subscriptions.hasOwnProperty('chat')) {
    subscriptions.chat = { subscribed: true }
    connection.then(() => {
      chatSubscriber = stompClient.subscribe('/topic/chat', onMessage.bind(this, 'chat'))
    })
  }
}
3982
public Chat getChat(String chatID) {

        try {

            MultipartBody request = Unirest.post(getBotAPIUrl() + "getChat")
                    .field("chat_id", chatID, "application/json; charset=utf8;");
            HttpResponse<String> response = request.asString();
            JSONObject jsonResponse = Utils.processResponse(response);

            if (jsonResponse != null && Utils.checkResponseStatus(jsonResponse)) {

                JSONObject result = jsonResponse.getJSONObject("result");

                return ChatImpl.createChat(result, this);
            }
        } catch (UnirestException e) {
            e.printStackTrace();
        }

        return null;
    }