mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-25 02:09:48 +01:00
Use the explicitly-configured server when one exists, otherwise do DNS querying
This commit is contained in:
parent
7239d3fdfd
commit
02272c0f87
@ -90,9 +90,6 @@ JabberPlugin::connectPlugin( bool startup )
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( server.isEmpty() )
|
||||
server = splitJid[1];
|
||||
|
||||
if ( port < 1 || port > 65535 || jid.isEmpty() || password.isEmpty() )
|
||||
{
|
||||
qDebug() << "Jabber credentials look wrong, not connecting";
|
||||
@ -100,7 +97,7 @@ JabberPlugin::connectPlugin( bool startup )
|
||||
}
|
||||
|
||||
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( peerOffline( QString ) ), SIGNAL( peerOffline( QString ) ) );
|
||||
|
@ -65,8 +65,11 @@ Jabber_p::Jabber_p( const QString& jid, const QString& password, const QString&
|
||||
|
||||
// general client setup
|
||||
m_client = new Jreen::Client( jid, password );
|
||||
m_client->setServer( server );
|
||||
m_client->setPort( port );
|
||||
if ( !server.isEmpty() )
|
||||
{
|
||||
m_client->setServer( server );
|
||||
m_client->setPort( port );
|
||||
}
|
||||
m_client->registerStanzaExtension(new TomahawkSipMessageFactory);
|
||||
m_client->setResource( QString( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) ) );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user