mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Remove message-spawning tests
This commit is contained in:
parent
676c7b9017
commit
bf5e619818
3 changed files with 4 additions and 78 deletions
|
@ -58,11 +58,8 @@ private:
|
|||
std::shared_ptr<twitch::TwitchUser> account = nullptr;
|
||||
|
||||
std::shared_ptr<Communi::IrcConnection> writeConnection = nullptr;
|
||||
|
||||
public:
|
||||
std::shared_ptr<Communi::IrcConnection> readConnection = nullptr;
|
||||
|
||||
private:
|
||||
std::mutex connectionMutex;
|
||||
uint32_t connectionGeneration = 0;
|
||||
|
||||
|
|
|
@ -79,15 +79,10 @@ Split::Split(ChannelManager &_channelManager, SplitContainer *parent)
|
|||
ezShortcut(this, "CTRL+R", &Split::doChangeChannel);
|
||||
|
||||
// xd
|
||||
//ezShortcut(this, "ALT+SHIFT+RIGHT", &Split::doIncFlexX);
|
||||
//ezShortcut(this, "ALT+SHIFT+LEFT", &Split::doDecFlexX);
|
||||
//ezShortcut(this, "ALT+SHIFT+UP", &Split::doIncFlexY);
|
||||
//ezShortcut(this, "ALT+SHIFT+DOWN", &Split::doDecFlexY);
|
||||
|
||||
#ifndef NDEBUG
|
||||
// F12: Toggle message spawning
|
||||
ezShortcut(this, "ALT+Q", &Split::doToggleMessageSpawning);
|
||||
#endif
|
||||
// ezShortcut(this, "ALT+SHIFT+RIGHT", &Split::doIncFlexX);
|
||||
// ezShortcut(this, "ALT+SHIFT+LEFT", &Split::doDecFlexX);
|
||||
// ezShortcut(this, "ALT+SHIFT+UP", &Split::doIncFlexY);
|
||||
// ezShortcut(this, "ALT+SHIFT+DOWN", &Split::doDecFlexY);
|
||||
|
||||
this->channelName.getValueChangedSignal().connect(
|
||||
std::bind(&Split::channelNameUpdated, this, std::placeholders::_1));
|
||||
|
@ -102,10 +97,6 @@ Split::Split(ChannelManager &_channelManager, SplitContainer *parent)
|
|||
this->input.clearSelection();
|
||||
}
|
||||
});
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
connect(timer, &QTimer::timeout, this, &Split::test);
|
||||
timer->start(1000);
|
||||
}
|
||||
|
||||
Split::~Split()
|
||||
|
@ -462,30 +453,6 @@ void Split::doCopy()
|
|||
QApplication::clipboard()->setText(this->view.getSelectedText());
|
||||
}
|
||||
|
||||
static std::vector<std::string> usernameVariants = {
|
||||
"pajlada", //
|
||||
"trump", //
|
||||
"Chancu", //
|
||||
"pajaWoman", //
|
||||
"fourtf", //
|
||||
"weneedmoreautisticbots", //
|
||||
"fourtfbot", //
|
||||
"pajbot", //
|
||||
"snusbot", //
|
||||
};
|
||||
|
||||
static std::vector<std::string> messageVariants = {
|
||||
"hehe", //
|
||||
"lol pajlada", //
|
||||
"hehe BANNEDWORD", //
|
||||
"someone ordered pizza", //
|
||||
"for ice poseidon", //
|
||||
"and delivery guy said it is for enza denino", //
|
||||
"!gn", //
|
||||
"for my laptop", //
|
||||
"should I buy a Herschel backpack?", //
|
||||
};
|
||||
|
||||
template <typename Iter, typename RandomGenerator>
|
||||
static Iter select_randomly(Iter start, Iter end, RandomGenerator &g)
|
||||
{
|
||||
|
@ -502,41 +469,6 @@ static Iter select_randomly(Iter start, Iter end)
|
|||
return select_randomly(start, end, gen);
|
||||
}
|
||||
|
||||
void Split::test()
|
||||
{
|
||||
if (this->testEnabled) {
|
||||
messages::MessageParseArgs args;
|
||||
|
||||
auto message =
|
||||
new Communi::IrcPrivateMessage(this->channelManager.ircManager.readConnection.get());
|
||||
|
||||
std::string text = *(select_randomly(messageVariants.begin(), messageVariants.end()));
|
||||
std::string username = *(select_randomly(usernameVariants.begin(), usernameVariants.end()));
|
||||
std::string usernameString = username + "!" + username + "@" + username;
|
||||
|
||||
QStringList params{"#pajlada", text.c_str()};
|
||||
|
||||
qDebug() << params;
|
||||
|
||||
message->setParameters(params);
|
||||
|
||||
message->setPrefix(usernameString.c_str());
|
||||
|
||||
auto twitchChannel = std::dynamic_pointer_cast<twitch::TwitchChannel>(this->channel);
|
||||
|
||||
twitch::TwitchMessageBuilder builder(
|
||||
twitchChannel.get(), this->channelManager.ircManager.resources,
|
||||
this->channelManager.emoteManager, this->channelManager.windowManager, message, args);
|
||||
|
||||
twitchChannel->addMessage(builder.parse());
|
||||
}
|
||||
}
|
||||
|
||||
void Split::doToggleMessageSpawning()
|
||||
{
|
||||
this->testEnabled = !this->testEnabled;
|
||||
}
|
||||
|
||||
void Split::doIncFlexX()
|
||||
{
|
||||
this->setFlexSizeX(this->getFlexSizeX() * 1.2);
|
||||
|
|
|
@ -52,7 +52,6 @@ public:
|
|||
CompletionManager &completionManager;
|
||||
pajlada::Settings::Setting<std::string> channelName;
|
||||
boost::signals2::signal<void()> channelChanged;
|
||||
bool testEnabled = false;
|
||||
|
||||
std::shared_ptr<Channel> getChannel() const;
|
||||
std::shared_ptr<Channel> &getChannelRef();
|
||||
|
@ -122,8 +121,6 @@ public slots:
|
|||
// Open viewer list of the channel
|
||||
void doOpenViewerList();
|
||||
|
||||
void doToggleMessageSpawning();
|
||||
void test();
|
||||
void doIncFlexX();
|
||||
void doDecFlexX();
|
||||
void doIncFlexY();
|
||||
|
|
Loading…
Reference in a new issue