File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -650,7 +650,28 @@ bool CChat::CharacterKeyHandler(CGUIKeyEventArgs KeyboardArgs)
650650
651651 // If the input isn't empty and isn't identical to the previous entry in history, add it to the history
652652 if (!m_strInputText.empty () && (m_pInputHistory->Empty () || m_pInputHistory->GetLast () != m_strInputText))
653- m_pInputHistory->Add (m_strInputText);
653+ {
654+ if (m_strCommand.empty () && m_strInputText[0 ] != ' /' )
655+ {
656+ // If the input is not a command, store it
657+ m_pInputHistory->Add (m_strInputText);
658+ }
659+ else if (m_strCommand.compare (" login" ) != 0 )
660+ {
661+ // If the input is a command, check that it isn't the 'login' command, if it is censor it
662+ char szInput[256 ];
663+ strncpy (szInput, m_strInputText.c_str () + 1 , 256 );
664+
665+ const char * szCommand;
666+ if (szInput[0 ])
667+ szCommand = strtok (szInput, " " );
668+
669+ if ((strcmp (szCommand, " login" ) != 0 ))
670+ m_pInputHistory->Add (m_strInputText);
671+ else if ((m_pInputHistory->Empty () || m_pInputHistory->GetLast () != std::string (" /login" )))
672+ m_pInputHistory->Add (" /login" );
673+ }
674+ }
654675
655676 SetInputVisible (false );
656677
You can’t perform that action at this time.
0 commit comments