Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion Client/core/CChat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,28 @@ bool CChat::CharacterKeyHandler(CGUIKeyEventArgs KeyboardArgs)

// If the input isn't empty and isn't identical to the previous entry in history, add it to the history
if (!m_strInputText.empty() && (m_pInputHistory->Empty() || m_pInputHistory->GetLast() != m_strInputText))
m_pInputHistory->Add(m_strInputText);
{
if (m_strCommand.empty() && m_strInputText[0] != '/')
{
// If the input is not a command, store it
m_pInputHistory->Add(m_strInputText);
}
else if (m_strCommand.compare("login") != 0)
{
// If the input is a command, check that it isn't the 'login' command, if it is censor it
char szInput[256];
strncpy(szInput, m_strInputText.c_str() + 1, 256);

const char* szCommand;
if (szInput[0])
szCommand = strtok(szInput, " ");

if ((strcmp(szCommand, "login") != 0))
m_pInputHistory->Add(m_strInputText);
else if ((m_pInputHistory->Empty() || m_pInputHistory->GetLast() != std::string("/login")))
m_pInputHistory->Add("/login");
}
}

SetInputVisible(false);

Expand Down
Loading