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:
@@ -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 ) ) );
|
||||||
|
@@ -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 ) ) );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user