mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
parent
c7feec20d8
commit
d182c22a4e
|
@ -6,6 +6,7 @@
|
|||
#include "debug/log.hpp"
|
||||
#include "emotemanager.hpp"
|
||||
#include "messages/messageparseargs.hpp"
|
||||
#include "settingsmanager.hpp"
|
||||
#include "twitch/twitchmessagebuilder.hpp"
|
||||
#include "twitch/twitchparsemessage.hpp"
|
||||
#include "twitch/twitchuser.hpp"
|
||||
|
@ -31,6 +32,9 @@ IrcManager::IrcManager(ChannelManager &_channelManager, Resources &_resources,
|
|||
, resources(_resources)
|
||||
, windowManager(_windowManager)
|
||||
{
|
||||
this->messageSuffix.append(' ');
|
||||
this->messageSuffix.append(QChar(0x206D));
|
||||
|
||||
AccountManager::getInstance().Twitch.userChanged.connect([this]() {
|
||||
this->setUser(AccountManager::getInstance().Twitch.getCurrent());
|
||||
|
||||
|
@ -177,11 +181,15 @@ void IrcManager::disconnect()
|
|||
this->writeConnection->close();
|
||||
}
|
||||
|
||||
void IrcManager::sendMessage(const QString &channelName, const QString &message)
|
||||
void IrcManager::sendMessage(const QString &channelName, QString message)
|
||||
{
|
||||
this->connectionMutex.lock();
|
||||
static int i = 0;
|
||||
|
||||
if (this->writeConnection) {
|
||||
if (SettingsManager::getInstance().allowDuplicateMessages && (++i % 2) == 0) {
|
||||
message.append(this->messageSuffix);
|
||||
}
|
||||
this->writeConnection->sendRaw("PRIVMSG #" + channelName + " :" + message);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
bool tryRemoveIgnoredUser(QString const &username, QString &errorMessage);
|
||||
void removeIgnoredUser(QString const &username);
|
||||
|
||||
void sendMessage(const QString &channelName, const QString &message);
|
||||
void sendMessage(const QString &channelName, QString message);
|
||||
|
||||
void joinChannel(const QString &channelName);
|
||||
void partChannel(const QString &channelName);
|
||||
|
@ -89,6 +89,9 @@ private:
|
|||
|
||||
void onConnected();
|
||||
void onDisconnected();
|
||||
|
||||
private:
|
||||
QByteArray messageSuffix;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
|
Loading…
Reference in a new issue