1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 22:26:32 +02:00

Merge remote-tracking branch 'origin/stable'

This commit is contained in:
Christian Muehlhaeuser
2011-03-28 05:01:50 +02:00
7 changed files with 38 additions and 12 deletions

View File

@@ -1,4 +1,6 @@
Version 0.0.2:
* Don't reconnect to Jabber if the settings dialog is closed successfully
but the Jabber settings haven't changed.
* Don't run a rescan of the local collection if the settings dialog is
closed successfully but the path hasn't changed.
* Don't attempt to connect to unavailable Twitter peers over and over.
@@ -10,9 +12,9 @@ Version 0.0.2:
the Tomahawk XMPP presence.
* Incompatible change: Twitter SIP protocol has changed slightly. 0.0.1
clients will not be able to talk to newer clients.
* Hopefully fix crashes during Twitter authentication.
* Hopefully fixed crashes during Twitter authentication.
* Don't let long playlist or summary names force a large Tomahawk window.
* Fixed Jabber auth: Freshly added contacts never showed up.
* Tomahawk now asks you to authorize new contacts.
Version 0.0.1:
* First public release.

View File

@@ -28,6 +28,7 @@
#include "network/controlconnection.h"
#include "sourcelist.h"
#include "tomahawksettings.h"
#include "tomahawk/tomahawkapp.h"
#include "config.h"
@@ -177,6 +178,20 @@ SipHandler::checkSettings()
void
SipHandler::connectPlugins( bool startup, const QString &pluginName )
{
#ifndef TOMAHAWK_HEADLESS
if ( !TomahawkSettings::instance()->acceptedLegalWarning() )
{
int result = QMessageBox::question(
TomahawkApp::instance()->mainWindow(), "Legal Warning",
"By pressing OK below, you agree that your use of Tomahawk will be in accordance with any applicable laws, including copyright and intellectual property laws, in effect in your country of residence, and indemify the Tomahawk developers and project from liability should you choose to break those laws.\n\nFor more information, please see http://gettomahawk.com/legal",
"I Do Not Agree", "I Agree"
);
if ( result != 1 )
return;
else
TomahawkSettings::instance()->setAcceptedLegalWarning( true );
}
#endif
foreach( SipPlugin* sip, m_plugins )
{
if ( pluginName.isEmpty() || ( !pluginName.isEmpty() && sip->name() == pluginName ) )

View File

@@ -77,10 +77,9 @@ JabberPlugin::connectPlugin( bool startup )
return false;
m_currentUsername = TomahawkSettings::instance()->jabberUsername();
m_currentPassword = TomahawkSettings::instance()->jabberPassword();
m_currentServer = TomahawkSettings::instance()->jabberServer();
m_currentPassword = TomahawkSettings::instance()->jabberPassword();
m_currentPort = TomahawkSettings::instance()->jabberPort();
QString server = m_currentServer;
QStringList splitJid = m_currentUsername.split( '@', QString::SkipEmptyParts );
@@ -181,7 +180,6 @@ void
JabberPlugin::checkSettings()
{
bool reconnect = false;
if ( m_currentUsername != TomahawkSettings::instance()->jabberUsername() )
reconnect = true;
if ( m_currentPassword != TomahawkSettings::instance()->jabberPassword() )

View File

@@ -51,7 +51,7 @@ public slots:
void disconnectPlugin()
{
onDisconnected();
if ( p )
p->disconnect();
@@ -84,15 +84,15 @@ private slots:
void showAddFriendDialog();
void onConnected();
void onDisconnected();
private:
Jabber_p* p;
QMenu* m_menu;
QAction* m_addFriendAction;
QString m_currentServer;
QString m_currentUsername;
QString m_currentPassword;
QString m_currentServer;
unsigned int m_currentPort;
};

View File

@@ -27,8 +27,8 @@
#include <QVariant>
#include <utils/tomahawkutils.h>
#include <gloox/capabilities.h>
#include <qjson/parser.h>
#include <QMessageBox>
#include <qjson/parser.h>
using namespace gloox;
using namespace std;

View File

@@ -168,6 +168,7 @@ TwitterPlugin::disconnectPlugin()
m_twitterAuth.data()->deleteLater();
m_cachedPeers.empty();
m_attemptedConnects.empty();
delete m_twitterAuth.data();
m_isOnline = false;
}
@@ -583,14 +584,16 @@ TwitterPlugin::registerOffer( const QString &screenName, const QHash< QString, Q
qDebug() << "TwitterPlugin did not send offer because external address is " << Servent::instance()->externalAddress() << " and external port is " << Servent::instance()->externalPort();
}
if ( m_isOnline && _peerData.contains( "host" ) && _peerData.contains( "port" ) && _peerData.contains( "pkey" ) )
QMetaObject::invokeMethod( this, "makeConnection", Q_ARG( QString, screenName ), QGenericArgument( "QHash< QString, QVariant >", (const void*)&_peerData ) );
if ( peersChanged )
{
m_cachedPeers[screenName] = QVariant::fromValue< QHash< QString, QVariant > >( _peerData );
TomahawkSettings::instance()->setTwitterCachedPeers( m_cachedPeers );
m_attemptedConnects[screenName] = false;
}
if ( m_isOnline && _peerData.contains( "host" ) && _peerData.contains( "port" ) && _peerData.contains( "pkey" ) )
QMetaObject::invokeMethod( this, "makeConnection", Q_ARG( QString, screenName ), QGenericArgument( "QHash< QString, QVariant >", (const void*)&_peerData ) );
}
void
@@ -611,6 +614,11 @@ void
TwitterPlugin::makeConnection( const QString &screenName, const QHash< QString, QVariant > &peerData )
{
qDebug() << Q_FUNC_INFO;
if ( m_attemptedConnects.contains( screenName ) && m_attemptedConnects[screenName] )
{
qDebug() << "Already attempted to connect to this peer with no change in their status, not trying again for now";
return;
}
if ( !peerData.contains( "host" ) || !peerData.contains( "port" ) || !peerData.contains( "pkey" ) || !peerData.contains( "node" ) )
{
qDebug() << "TwitterPlugin could not find host and/or port and/or pkey for peer " << screenName;
@@ -623,6 +631,7 @@ TwitterPlugin::makeConnection( const QString &screenName, const QHash< QString,
peerData["pkey"].toString(),
friendlyName,
peerData["node"].toString() );
m_attemptedConnects[screenName] = true;
}
void
@@ -630,6 +639,7 @@ TwitterPlugin::directMessagePosted( const QTweetDMStatus& message )
{
qDebug() << Q_FUNC_INFO;
qDebug() << "TwitterPlugin sent message to " << message.recipientScreenName() << " containing: " << message.text();
}
void

View File

@@ -108,6 +108,7 @@ private:
qint64 m_cachedMentionsSinceId;
qint64 m_cachedDirectMessagesSinceId;
QHash< QString, QVariant > m_cachedPeers;
QHash< QString, bool > m_attemptedConnects;
QSet<QString> m_keyCache;
bool m_finishedFriends;
bool m_finishedMentions;