mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
sipjreen: regressions--: handle server and port settings correctly
This commit is contained in:
@@ -61,6 +61,8 @@ JabberPlugin::JabberPlugin()
|
|||||||
|
|
||||||
// general client setup
|
// general client setup
|
||||||
m_client = new Jreen::Client( jid, m_currentPassword );
|
m_client = new Jreen::Client( jid, m_currentPassword );
|
||||||
|
setupClientHelper();
|
||||||
|
|
||||||
m_client->registerStanzaExtension(new TomahawkSipMessageFactory);
|
m_client->registerStanzaExtension(new TomahawkSipMessageFactory);
|
||||||
m_currentResource = QString::fromAscii( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) );
|
m_currentResource = QString::fromAscii( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) );
|
||||||
m_client->setResource( m_currentResource );
|
m_client->setResource( m_currentResource );
|
||||||
@@ -439,17 +441,34 @@ JabberPlugin::checkSettings()
|
|||||||
m_currentServer = TomahawkSettings::instance()->jabberServer();
|
m_currentServer = TomahawkSettings::instance()->jabberServer();
|
||||||
m_currentPort = TomahawkSettings::instance()->jabberPort();
|
m_currentPort = TomahawkSettings::instance()->jabberPort();
|
||||||
|
|
||||||
Jreen::JID jid = Jreen::JID( accountName() );
|
setupClientHelper();
|
||||||
m_client->setJID( jid );
|
|
||||||
m_client->setPassword( m_currentPassword );
|
|
||||||
m_client->setServer( m_currentServer );
|
|
||||||
m_client->setPort( m_currentPort );
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Updated settings";
|
qDebug() << Q_FUNC_INFO << "Updated settings";
|
||||||
connectPlugin( false );
|
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()
|
void JabberPlugin::addMenuHelper()
|
||||||
{
|
{
|
||||||
if( !m_menu )
|
if( !m_menu )
|
||||||
|
@@ -93,6 +93,7 @@ private slots:
|
|||||||
void onNewAvatar( const QString &jid );
|
void onNewAvatar( const QString &jid );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setupClientHelper();
|
||||||
void addMenuHelper();
|
void addMenuHelper();
|
||||||
void removeMenuHelper();
|
void removeMenuHelper();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user