added debug logs and code to assert that we are in the gui thread

This commit is contained in:
fourtf
2018-04-26 18:10:26 +02:00
parent b176dc5295
commit d078ef5fe0
22 changed files with 81 additions and 13 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ void AbstractIrcServer::connect()
}
this->onConnected();
this->connected.invoke();
// this->connected.invoke();
}
void AbstractIrcServer::disconnect()
@@ -9,8 +9,8 @@ namespace providers {
namespace twitch {
TwitchAccountManager::TwitchAccountManager()
: anonymousUser(new TwitchAccount(ANONYMOUS_USERNAME, "", "", ""))
{
this->anonymousUser.reset(new TwitchAccount(ANONYMOUS_USERNAME, "", "", ""));
}
std::shared_ptr<TwitchAccount> TwitchAccountManager::getCurrent()
+6 -3
View File
@@ -21,9 +21,10 @@ TwitchServer::TwitchServer()
, mentionsChannel(new Channel("/mentions", Channel::TwitchMentions))
, watchingChannel(Channel::getEmpty(), Channel::TwitchWatching)
{
AccountManager::getInstance().Twitch.userChanged.connect([this]() { //
util::postToThread([this] { this->connect(); });
});
qDebug() << "init TwitchServer";
AccountManager::getInstance().Twitch.userChanged.connect(
[this]() { util::postToThread([this] { this->connect(); }); });
}
TwitchServer &TwitchServer::getInstance()
@@ -36,6 +37,8 @@ void TwitchServer::initializeConnection(IrcConnection *connection, bool isRead,
{
std::shared_ptr<TwitchAccount> account = AccountManager::getInstance().Twitch.getCurrent();
qDebug() << "logging in as" << account->getUserName();
QString username = account->getUserName();
// QString oauthClient = account->getOAuthClient();
QString oauthToken = account->getOAuthToken();