diff --git a/src/aoclient.h b/src/aoclient.h index ef22643..74aee1f 100644 --- a/src/aoclient.h +++ b/src/aoclient.h @@ -516,7 +516,7 @@ class AOClient : public QObject * * @details Used to determine if the incoming message is a duplicate. */ - QString m_last_message; + QString m_last_message = " "; /** * @brief The time in seconds since the client last sent a Witness Testimony / Cross Examination diff --git a/src/commands/casing.cpp b/src/commands/casing.cpp index 636da15..f27796d 100644 --- a/src/commands/casing.cpp +++ b/src/commands/casing.cpp @@ -175,12 +175,12 @@ void AOClient::cmdTestify(int argc, QStringList argv) AreaData *l_area = server->getAreaById(areaId()); if (l_area->testimonyRecording() == AreaData::TestimonyRecording::RECORDING) { - sendServerMessage("Testimony recording is already in progress. Please stop it with /end before starting a new one."); + sendServerMessage("Testimony recording is already in progress. Please stop it with /pause before starting a new one."); } else { clearTestimony(); l_area->setTestimonyRecording(AreaData::TestimonyRecording::RECORDING); - sendServerMessage("Started testimony recording. The next IC message will be a title. Use /end to stop recording."); + sendServerMessage("Started testimony recording. The next IC message will be a title. Use /pause to stop recording."); } } diff --git a/src/packet/packet_ms.cpp b/src/packet/packet_ms.cpp index 8701e33..cb94adf 100644 --- a/src/packet/packet_ms.cpp +++ b/src/packet/packet_ms.cpp @@ -127,12 +127,9 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const // Doublepost prevention. Has to ignore blankposts and testimony commands. QString l_incoming_msg = client.dezalgo(l_incoming_args[4].toString().trimmed()); QRegularExpressionMatch match = isTestimonyJumpCommand(client.decodeMessage(l_incoming_msg)); - bool msg_is_testimony_cmd = (match.hasMatch() || l_incoming_msg == ">" || l_incoming_msg == "<"); - if (!client.m_last_message.isEmpty() // If the last message you sent isn't empty, - && l_incoming_msg == client.m_last_message // and it matches the one you're sending, - && !msg_is_testimony_cmd) // and it's not a testimony command, - return l_invalid; // get it the hell outta here! - + bool msg_is_testimony_cmd = (area->statement() != -1 && (match.hasMatch() || l_incoming_msg == ">" || l_incoming_msg == "<")); + if (l_incoming_msg == client.m_last_message && !msg_is_testimony_cmd) return l_invalid; + if (l_incoming_msg == "" && area->blankpostingAllowed() == false) { client.sendServerMessage("Blankposting has been forbidden in this area."); return l_invalid;