MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / doChat

Method doChat

source/frontend/StarMainInterface.cpp:874–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872}
873
874void MainInterface::doChat(String const& chat, bool addToHistory) {
875 if (chat.empty())
876 return;
877
878 if (chat.beginsWith("/")) {
879 m_lastCommand = chat;
880
881 for (auto const& result : m_clientCommandProcessor->handleCommand(chat, true))
882 m_chat->addLine(result);
883 } else {
884 m_client->sendChat(chat, m_chat->sendMode());
885 }
886
887 if (addToHistory)
888 m_chat->addHistory(chat);
889}
890
891void MainInterface::queueMessage(String const& message, Maybe<float> cooldown, float spring) {
892 auto guiMessage = make_shared<GuiMessage>(message, cooldown.value(m_config->messageTime), spring);

Callers

nothing calls this directly

Calls 7

addLineMethod · 0.80
sendChatMethod · 0.80
sendModeMethod · 0.80
addHistoryMethod · 0.80
emptyMethod · 0.45
beginsWithMethod · 0.45
handleCommandMethod · 0.45

Tested by

no test coverage detected