diff --git a/src/sip/jreen/jabber.cpp b/src/sip/jreen/jabber.cpp index 7e0b1235e..e01c5d93e 100644 --- a/src/sip/jreen/jabber.cpp +++ b/src/sip/jreen/jabber.cpp @@ -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 ) ) ); diff --git a/src/sip/jreen/jabber_p.cpp b/src/sip/jreen/jabber_p.cpp index 5e4732665..1af6693d7 100644 --- a/src/sip/jreen/jabber_p.cpp +++ b/src/sip/jreen/jabber_p.cpp @@ -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 ) ) );