1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Use the explicitly-configured server when one exists, otherwise do DNS querying

This commit is contained in:
Jeff Mitchell
2011-04-22 13:11:57 -04:00
parent 7239d3fdfd
commit 02272c0f87
2 changed files with 6 additions and 6 deletions

View File

@@ -90,9 +90,6 @@ JabberPlugin::connectPlugin( bool startup )
return false; return false;
} }
if ( server.isEmpty() )
server = splitJid[1];
if ( port < 1 || port > 65535 || jid.isEmpty() || password.isEmpty() ) if ( port < 1 || port > 65535 || jid.isEmpty() || password.isEmpty() )
{ {
qDebug() << "Jabber credentials look wrong, not connecting"; qDebug() << "Jabber credentials look wrong, not connecting";
@@ -100,7 +97,7 @@ JabberPlugin::connectPlugin( bool startup )
} }
delete p; delete p;
p = new Jabber_p( jid, password, server, port ); p = new Jabber_p( jid, password, ( server.isEmpty() ? QString() : server ), port );
QObject::connect( p, SIGNAL( peerOnline( QString ) ), SIGNAL( peerOnline( QString ) ) ); QObject::connect( p, SIGNAL( peerOnline( QString ) ), SIGNAL( peerOnline( QString ) ) );
QObject::connect( p, SIGNAL( peerOffline( QString ) ), SIGNAL( peerOffline( QString ) ) ); QObject::connect( p, SIGNAL( peerOffline( QString ) ), SIGNAL( peerOffline( QString ) ) );

View File

@@ -65,8 +65,11 @@ Jabber_p::Jabber_p( const QString& jid, const QString& password, const QString&
// general client setup // general client setup
m_client = new Jreen::Client( jid, password ); m_client = new Jreen::Client( jid, password );
m_client->setServer( server ); if ( !server.isEmpty() )
m_client->setPort( port ); {
m_client->setServer( server );
m_client->setPort( port );
}
m_client->registerStanzaExtension(new TomahawkSipMessageFactory); m_client->registerStanzaExtension(new TomahawkSipMessageFactory);
m_client->setResource( QString( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) ) ); m_client->setResource( QString( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) ) );