537 { |
537 { |
538 chatEditLine->removeNickname(nick); |
538 chatEditLine->removeNickname(nick); |
539 |
539 |
540 emit nickCountUpdate(chatNicks->model()->rowCount()); |
540 emit nickCountUpdate(chatNicks->model()->rowCount()); |
541 |
541 |
542 if (message.isEmpty()) |
542 // Normal quit |
|
543 if (message.isEmpty() || message == "bye") |
543 printChatString(nick, QString("*** ") + tr("%1 has left").arg(linkedNick(nick)), "Leave", false); |
544 printChatString(nick, QString("*** ") + tr("%1 has left").arg(linkedNick(nick)), "Leave", false); |
|
545 // Quit with custom player message |
|
546 else if (message.startsWith("User quit: ") && message.length() > 11) |
|
547 { |
|
548 QString playerMessage = QString(message); |
|
549 playerMessage.remove(0, 11); |
|
550 printChatString(nick, QString("*** ") + tr("%1 has left (message: \"%2\")").arg(linkedNick(nick)).arg(playerMessage.toHtmlEscaped()), "Leave", false); |
|
551 } |
|
552 // Quit with special PART message |
|
553 else if (message.startsWith("part: ") && message.length() > 6) |
|
554 { |
|
555 QString playerMessage = QString(message); |
|
556 playerMessage.remove(0, 6); |
|
557 printChatString(nick, QString("*** ") + tr("%1 has left (%2)").arg(linkedNick(nick).arg(playerMessage.toHtmlEscaped())), "Leave", false); |
|
558 } |
|
559 // Quit with additional server message (i.e. ping timeout) |
544 else |
560 else |
545 printChatString(nick, QString("*** ") + tr("%1 has left (%2)").arg(linkedNick(nick)).arg(messageToHTML(message)), "Leave", false); |
561 { |
|
562 printChatString(nick, QString("*** ") + tr("%1 has left (%2)").arg(linkedNick(nick)).arg(HWApplication::translate("server", message.toLatin1().constData()).toHtmlEscaped()), "Leave", false); |
|
563 } |
546 } |
564 } |
547 |
565 |
548 void HWChatWidget::clear() |
566 void HWChatWidget::clear() |
549 { |
567 { |
550 chatEditLine->reset(); |
568 chatEditLine->reset(); |