Fixes #210 aallow duplicate messages behaves weird

This commit is contained in:
fourtf
2018-01-22 15:24:39 +01:00
parent d966c24bc3
commit 9d8edc4ae0
4 changed files with 18 additions and 11 deletions
-7
View File
@@ -34,9 +34,6 @@ IrcManager::IrcManager(ChannelManager &_channelManager, ResourceManager &_resour
, resources(_resources)
, accountManager(_accountManager)
{
this->messageSuffix.append(' ');
this->messageSuffix.append(QChar(0x206D));
this->account = accountManager.Twitch.getCurrent();
accountManager.Twitch.userChanged.connect([this]() {
this->setUser(accountManager.Twitch.getCurrent());
@@ -208,12 +205,8 @@ void IrcManager::sendMessage(const QString &channelName, QString message)
}
this->connectionMutex.lock();
static int i = 0;
if (this->writeConnection) {
if (singletons::SettingManager::getInstance().allowDuplicateMessages && (++i % 2) == 0) {
trimmedMessage.append(this->messageSuffix);
}
this->writeConnection->sendRaw("PRIVMSG #" + channelName + " :" + trimmedMessage);
}