mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-18 23:09:42 +01:00
Fix some twitter stuff
This commit is contained in:
parent
0a3dc28bdf
commit
e2749a7676
@ -59,6 +59,8 @@ TwitterSipPlugin::TwitterSipPlugin( Tomahawk::Accounts::Account* account )
|
||||
|
||||
connect( account, SIGNAL( nowAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &, const QTweetUser & ) ), SLOT( accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &, const QTweetUser & ) ) );
|
||||
|
||||
m_configuration = account->configuration();
|
||||
qDebug() << "SIP configuration:" << m_configuration << m_configuration[ "cachedpeers" ];
|
||||
if ( Database::instance()->dbid() != m_account->configuration()[ "saveddbid" ].toString() )
|
||||
{
|
||||
m_configuration[ "cachedpeers" ] = QVariantHash();
|
||||
|
@ -50,6 +50,8 @@ TwitterAccount::TwitterAccount( const QString &accountId )
|
||||
setAccountServiceName( "Twitter" );
|
||||
setTypes( AccountTypes( InfoType | SipType ) );
|
||||
|
||||
qDebug() << "Got cached peers:" << configuration() << configuration()[ "cachedpeers" ];
|
||||
|
||||
m_configWidget = QWeakPointer< TwitterConfigWidget >( new TwitterConfigWidget( this, 0 ) );
|
||||
connect( m_configWidget.data(), SIGNAL( twitterAuthed( bool ) ), SLOT( configDialogAuthedSignalSlot( bool ) ) );
|
||||
|
||||
@ -86,6 +88,7 @@ TwitterAccount::sipPlugin()
|
||||
{
|
||||
if ( m_twitterSipPlugin.isNull() )
|
||||
{
|
||||
qDebug() << "CHECKING:" << configuration() << configuration()[ "cachedpeers" ];
|
||||
m_twitterSipPlugin = QWeakPointer< TwitterSipPlugin >( new TwitterSipPlugin( this ) );
|
||||
|
||||
connect( m_twitterSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) );
|
||||
|
@ -231,17 +231,22 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
||||
continue;
|
||||
|
||||
QVariantHash credentials;
|
||||
credentials[ "cachedfriendssinceid" ] = value( sipPlugin + "/cachedfriendssinceid" );
|
||||
credentials[ "cacheddirectmessagessinceid" ] = value( sipPlugin + "/cacheddirectmessagessinceid" );
|
||||
credentials[ "cachedpeers" ] = value( sipPlugin + "/cachedpeers" );
|
||||
credentials[ "oauthtoken" ] = value( sipPlugin + "/oauthtoken" );
|
||||
credentials[ "oauthtokensecret" ] = value( sipPlugin + "/oauthtokensecret" );
|
||||
credentials[ "cachedmentionssinceid" ] = value( sipPlugin + "/cachedmentionssinceid" );
|
||||
credentials[ "username" ] = value( sipPlugin + "/screenname" );
|
||||
credentials[ "saveddbid" ] = value( sipPlugin + "/saveddbid" );
|
||||
|
||||
QVariantHash configuration;
|
||||
configuration[ "cachedfriendssinceid" ] = value( sipPlugin + "/cachedfriendssinceid" );
|
||||
configuration[ "cacheddirectmessagessinceid" ] = value( sipPlugin + "/cacheddirectmessagessinceid" );
|
||||
configuration[ "cachedpeers" ] = value( sipPlugin + "/cachedpeers" );
|
||||
qDebug() << "FOUND CACHED PEERS:" << value( sipPlugin + "/cachedpeers" ).toHash();
|
||||
configuration[ "cachedmentionssinceid" ] = value( sipPlugin + "/cachedmentionssinceid" );
|
||||
configuration[ "saveddbid" ] = value( sipPlugin + "/saveddbid" );
|
||||
|
||||
setValue( QString( "accounts/%1/credentials" ).arg( accountKey ), credentials );
|
||||
setValue( QString( "accounts/%1/configuration" ).arg( accountKey ), configuration );
|
||||
setValue( QString( "accounts/%1/accountfriendlyname" ).arg( accountKey ), "@" + value( sipPlugin + "/screenname" ).toString() );
|
||||
sync();
|
||||
}
|
||||
else if ( pluginName == "sipzeroconf" )
|
||||
{
|
||||
@ -251,7 +256,6 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
||||
beginGroup( "accounts/" + accountKey );
|
||||
setValue( "enabled", enabledSip.contains( sipPlugin ) == true );
|
||||
setValue( "autoconnect", true );
|
||||
setValue( "configuration", QVariantHash() );
|
||||
setValue( "acl", QVariantMap() );
|
||||
setValue( "types", QStringList() << "SipType" );
|
||||
endGroup();
|
||||
|
Loading…
x
Reference in New Issue
Block a user