mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
createTimeoutMessage now also handles permaban-messages
This commit is contained in:
parent
d905e88671
commit
357515ab39
1 changed files with 13 additions and 9 deletions
|
@ -117,17 +117,21 @@ Message *Message::createTimeoutMessage(const QString &username, const QString &d
|
||||||
QString text;
|
QString text;
|
||||||
|
|
||||||
text.append(username);
|
text.append(username);
|
||||||
text.append(" has been timed out");
|
if (!durationInSeconds.isEmpty()) {
|
||||||
|
text.append(" has been timed out");
|
||||||
|
|
||||||
// TODO: Implement who timed the user out
|
// TODO: Implement who timed the user out
|
||||||
|
|
||||||
text.append(" for ");
|
text.append(" for ");
|
||||||
text.append(durationInSeconds);
|
text.append(durationInSeconds);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
int timeoutDuration = durationInSeconds.toInt(&ok);
|
int timeoutDuration = durationInSeconds.toInt(&ok);
|
||||||
text.append(" second");
|
text.append(" second");
|
||||||
if (ok && timeoutDuration > 1) {
|
if (ok && timeoutDuration > 1) {
|
||||||
text.append("s");
|
text.append("s");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
text.append(" has been permanently banned");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reason.length() > 0) {
|
if (reason.length() > 0) {
|
||||||
|
|
Loading…
Reference in a new issue