mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-22 16:59:58 +01:00
sipjreen: regressions--: handle server and port settings correctly
This commit is contained in:
parent
92f23bc20b
commit
81065243f4
@ -61,6 +61,8 @@ JabberPlugin::JabberPlugin()
|
||||
|
||||
// general client setup
|
||||
m_client = new Jreen::Client( jid, m_currentPassword );
|
||||
setupClientHelper();
|
||||
|
||||
m_client->registerStanzaExtension(new TomahawkSipMessageFactory);
|
||||
m_currentResource = QString::fromAscii( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) );
|
||||
m_client->setResource( m_currentResource );
|
||||
@ -439,17 +441,34 @@ JabberPlugin::checkSettings()
|
||||
m_currentServer = TomahawkSettings::instance()->jabberServer();
|
||||
m_currentPort = TomahawkSettings::instance()->jabberPort();
|
||||
|
||||
Jreen::JID jid = Jreen::JID( accountName() );
|
||||
m_client->setJID( jid );
|
||||
m_client->setPassword( m_currentPassword );
|
||||
m_client->setServer( m_currentServer );
|
||||
m_client->setPort( m_currentPort );
|
||||
setupClientHelper();
|
||||
|
||||
qDebug() << Q_FUNC_INFO << "Updated settings";
|
||||
connectPlugin( false );
|
||||
}
|
||||
}
|
||||
|
||||
void JabberPlugin::setupClientHelper()
|
||||
{
|
||||
Jreen::JID jid = Jreen::JID( m_currentUsername );
|
||||
|
||||
m_client->setJID( jid );
|
||||
m_client->setPassword( m_currentPassword );
|
||||
|
||||
if( !m_currentServer.isEmpty() )
|
||||
{
|
||||
// set explicit server details
|
||||
m_client->setServer( m_currentServer );
|
||||
m_client->setPort( m_currentPort );
|
||||
}
|
||||
else
|
||||
{
|
||||
// let jreen find out server and port via jdns
|
||||
m_client->setServer( jid.domain() );
|
||||
m_client->setPort( -1 );
|
||||
}
|
||||
}
|
||||
|
||||
void JabberPlugin::addMenuHelper()
|
||||
{
|
||||
if( !m_menu )
|
||||
|
@ -93,6 +93,7 @@ private slots:
|
||||
void onNewAvatar( const QString &jid );
|
||||
|
||||
private:
|
||||
void setupClientHelper();
|
||||
void addMenuHelper();
|
||||
void removeMenuHelper();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user