mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-26 23:35:32 +02:00
Remove now-unnecessary and buggy proxy code in jabber plugin
This commit is contained in:
@@ -359,15 +359,6 @@ InfoSystemWorker::newNam()
|
||||
newNam->setProxyFactory( newProxyFactory );
|
||||
m_nam = QWeakPointer< QNetworkAccessManager >( newNam );
|
||||
|
||||
QNetworkProxy m_usedProxy = oldProxyFactory->queryProxy( QNetworkProxyQuery( "www.google.com", 5522 ) ).first();
|
||||
QNetworkProxy proxyToUse = newProxyFactory->queryProxy( QNetworkProxyQuery( "www.google.com", 5522 ) ).first();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse host: " << proxyToUse.hostName() << ", usedProxy host: " << m_usedProxy.hostName();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse port: " << proxyToUse.port() << ", usedProxy port: " << m_usedProxy.port();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse user: " << proxyToUse.user() << ", usedProxy user: " << m_usedProxy.user();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse pass: " << proxyToUse.password() << ", usedProxy pass: " << m_usedProxy.password();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse type: " << proxyToUse.type() << ", usedProxy type: " << m_usedProxy.type();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse caps: " << proxyToUse.capabilities() << ", usedProxy caps: " << m_usedProxy.capabilities();
|
||||
|
||||
emit namChanged( m_nam.data() );
|
||||
|
||||
//FIXME: Currently leaking nam/proxyfactory above -- how to change in a thread-safe way?
|
||||
|
@@ -153,30 +153,6 @@ JabberPlugin::~JabberPlugin()
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void
|
||||
JabberPlugin::refreshProxy()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
if( !m_client->connection() )
|
||||
return;
|
||||
|
||||
QNetworkProxy proxyToUse = TomahawkUtils::proxyFactory()->queryProxy( QNetworkProxyQuery( m_currentServer, m_currentPort ) ).first();
|
||||
m_usedProxy = proxyToUse;
|
||||
|
||||
if( proxyToUse.type() != QNetworkProxy::NoProxy && ( m_currentServer.isEmpty() || !(m_currentPort > 0) ) )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << " proxy type is not noproxy but no server/port set";
|
||||
// patches are welcome in Jreen that implement jdns through proxy
|
||||
emit error( SipPlugin::ConnectionError,
|
||||
tr( "You need to set hostname and port of your jabber server, if you want to use it through a proxy" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << Q_FUNC_INFO << " proxy type is NoProxy ? " << (proxyToUse.type() == QNetworkProxy::NoProxy ? "true" : "false" );
|
||||
qobject_cast<Jreen::DirectConnection*>( m_client->connection() )->setProxy( proxyToUse );
|
||||
}
|
||||
|
||||
|
||||
const QString
|
||||
JabberPlugin::name() const
|
||||
@@ -227,8 +203,6 @@ JabberPlugin::connectPlugin( bool startup )
|
||||
return true; //FIXME: should i return false here?!
|
||||
}
|
||||
|
||||
refreshProxy();
|
||||
|
||||
qDebug() << "Connecting to the XMPP server..." << m_client->jid().full();
|
||||
|
||||
//FIXME: we're badly workarounding some missing reconnection api here, to be fixed soon
|
||||
@@ -523,22 +497,6 @@ JabberPlugin::checkSettings()
|
||||
if ( m_currentPort != readPort() )
|
||||
reconnect = true;
|
||||
|
||||
QNetworkProxy proxyToUse = TomahawkUtils::proxyFactory()->queryProxy( QNetworkProxyQuery( m_currentServer, m_currentPort ) ).first();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse host: " << proxyToUse.hostName() << ", usedProxy host: " << m_usedProxy.hostName();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse port: " << proxyToUse.port() << ", usedProxy port: " << m_usedProxy.port();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse user: " << proxyToUse.user() << ", usedProxy user: " << m_usedProxy.user();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse pass: " << proxyToUse.password() << ", usedProxy pass: " << m_usedProxy.password();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse type: " << proxyToUse.type() << ", usedProxy type: " << m_usedProxy.type();
|
||||
qDebug() << Q_FUNC_INFO << "proxyToUse caps: " << proxyToUse.capabilities() << ", usedProxy caps: " << m_usedProxy.capabilities();
|
||||
if ( proxyToUse.hostName() != m_usedProxy.hostName() ||
|
||||
proxyToUse.port() != m_usedProxy.port() ||
|
||||
proxyToUse.user() != m_usedProxy.user() ||
|
||||
proxyToUse.password() != m_usedProxy.password() ||
|
||||
proxyToUse.type() != m_usedProxy.type() ||
|
||||
proxyToUse.capabilities() != m_usedProxy.capabilities()
|
||||
)
|
||||
reconnect = true;
|
||||
|
||||
m_currentUsername = accountName();
|
||||
m_currentPassword = readPassword();
|
||||
m_currentServer = readServer();
|
||||
|
@@ -38,7 +38,6 @@
|
||||
#include <jreen/connection.h>
|
||||
#include <jreen/mucroom.h>
|
||||
|
||||
#include <QNetworkProxy>
|
||||
#include <QMessageBox>
|
||||
|
||||
#define MYNAME "SIPJREEN"
|
||||
@@ -95,7 +94,6 @@ public slots:
|
||||
void sendMsg( const QString& to, const QString& msg );
|
||||
void broadcastMsg( const QString &msg );
|
||||
void addContact( const QString &jid, const QString& msg = QString() );
|
||||
void refreshProxy();
|
||||
void showAddFriendDialog();
|
||||
|
||||
protected:
|
||||
@@ -159,8 +157,6 @@ private:
|
||||
enum IqContext { NoContext, RequestDisco, RequestedDisco, SipMessageSent, RequestedVCard, RequestVersion, RequestedVersion };
|
||||
QStringList m_legacy_peers;
|
||||
AvatarManager *m_avatarManager;
|
||||
|
||||
QNetworkProxy m_usedProxy;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user