fix: truncate outgoing IRC messages to ensure we don't send more than 512 bytes (#5246)

This commit is contained in:
pajlada
2024-03-10 14:00:52 +01:00
committed by GitHub
parent a958619860
commit e56f7136a9
4 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ public:
void disconnect();
void sendMessage(const QString &channelName, const QString &message);
void sendRawMessage(const QString &rawMessage);
virtual void sendRawMessage(const QString &rawMessage);
// channels
ChannelPtr getOrAddChannel(const QString &dirtyChannelName);
+5
View File
@@ -371,6 +371,11 @@ void IrcServer::sendWhisper(const QString &target, const QString &message)
}
}
void IrcServer::sendRawMessage(const QString &rawMessage)
{
AbstractIrcServer::sendRawMessage(rawMessage.left(510));
}
bool IrcServer::hasEcho() const
{
return this->hasEcho_;
+2
View File
@@ -25,6 +25,8 @@ public:
*/
void sendWhisper(const QString &target, const QString &message);
void sendRawMessage(const QString &rawMessage) override;
// AbstractIrcServer interface
protected:
void initializeConnectionSignals(IrcConnection *connection,