QTfrontend/ui/widget/chatwidget.cpp
changeset 13844 184584b82c4c
parent 13843 7c333cffd63e
child 13846 d8e606cf8ff5
equal deleted inserted replaced
13843:7c333cffd63e 13844:184584b82c4c
   866 bool HWChatWidget::parseCommand(const QString & line)
   866 bool HWChatWidget::parseCommand(const QString & line)
   867 {
   867 {
   868     if (line[0] == '/')
   868     if (line[0] == '/')
   869     {
   869     {
   870         QString tline = line.trimmed();
   870         QString tline = line.trimmed();
       
   871         if (tline.length() <= 1)
       
   872         {
       
   873             // Empty chat command
       
   874             displayWarning(QCoreApplication::translate("server", "Unknown command or invalid parameters. Say '/help' in chat for a list of commands."));
       
   875             return true;
       
   876         }
   871         if (tline.startsWith("/me"))
   877         if (tline.startsWith("/me"))
   872             return false; // not a real command
   878             return false; // not a real command
   873         else if (tline == "/clear") {
   879         else if (tline == "/clear") {
   874             chatStrings.clear();
   880             chatStrings.clear();
   875             chatText->clear();
   881             chatText->clear();