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