mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +02:00
Only connect XMPP plugin when credentials are loaded
This commit is contained in:
@@ -40,6 +40,7 @@ XmppAccountFactory::createAccount( const QString& accountId )
|
|||||||
|
|
||||||
XmppAccount::XmppAccount( const QString &accountId )
|
XmppAccount::XmppAccount( const QString &accountId )
|
||||||
: Account( accountId )
|
: Account( accountId )
|
||||||
|
, m_credentialsLoading( true )
|
||||||
{
|
{
|
||||||
connect( this, SIGNAL( credentialsLoaded( QVariantHash ) ), this, SLOT( onCredentialsLoaded( QVariantHash ) ) );
|
connect( this, SIGNAL( credentialsLoaded( QVariantHash ) ), this, SLOT( onCredentialsLoaded( QVariantHash ) ) );
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ XmppAccount::~XmppAccount()
|
|||||||
void
|
void
|
||||||
XmppAccount::authenticate()
|
XmppAccount::authenticate()
|
||||||
{
|
{
|
||||||
if ( connectionState() != Account::Connected )
|
if ( connectionState() != Account::Connected && !m_credentialsLoading )
|
||||||
sipPlugin()->connectPlugin();
|
sipPlugin()->connectPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ void
|
|||||||
XmppAccount::onCredentialsLoaded( const QVariantHash& credentials )
|
XmppAccount::onCredentialsLoaded( const QVariantHash& credentials )
|
||||||
{
|
{
|
||||||
m_credentials = credentials;
|
m_credentials = credentials;
|
||||||
|
m_credentialsLoading = false;
|
||||||
if ( !m_xmppSipPlugin.isNull() )
|
if ( !m_xmppSipPlugin.isNull() )
|
||||||
m_xmppSipPlugin.data()->configurationChanged();
|
m_xmppSipPlugin.data()->configurationChanged();
|
||||||
}
|
}
|
||||||
|
@@ -91,6 +91,7 @@ protected:
|
|||||||
QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin;
|
QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin;
|
||||||
|
|
||||||
QVariantHash m_credentials;
|
QVariantHash m_credentials;
|
||||||
|
bool m_credentialsLoading;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -581,6 +581,7 @@ XmppSipPlugin::configurationChanged()
|
|||||||
server = readServer();
|
server = readServer();
|
||||||
port = readPort();
|
port = readPort();
|
||||||
|
|
||||||
|
qDebug() << Q_FUNC_INFO << "Configuration changed in SIP plugin:" << username << password << server << port << m_account->accountFriendlyName();
|
||||||
if ( m_currentUsername != username )
|
if ( m_currentUsername != username )
|
||||||
{
|
{
|
||||||
m_currentUsername = username;
|
m_currentUsername = username;
|
||||||
@@ -610,6 +611,8 @@ XmppSipPlugin::configurationChanged()
|
|||||||
m_xmppAccount->saveCredentials( credentials );
|
m_xmppAccount->saveCredentials( credentials );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
qDebug() << Q_FUNC_INFO << "reconnecting?" << reconnect << "enabled?" << m_account->enabled() << m_account->accountFriendlyName();
|
||||||
if ( reconnect )
|
if ( reconnect )
|
||||||
setupClientHelper();
|
setupClientHelper();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user