1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 08:34:34 +02:00

* Fixed SIP jabber behaviour.

This commit is contained in:
Christian Muehlhaeuser
2011-02-28 02:01:52 +01:00
parent 116a1d8501
commit 328cd7eb6d

View File

@@ -41,18 +41,6 @@ Jabber_p::Jabber_p( const QString& jid, const QString& password, const QString&
qDebug() << "Our JID set to:" << m_jid.full().c_str();
// the google hack, because they filter disco features they don't know.
if( m_jid.server().find( "googlemail." ) != string::npos
|| m_jid.server().find( "gmail." ) != string::npos
|| m_jid.server().find( "gtalk." ) != string::npos )
{
if( m_jid.resource().find( "tomahawk" ) == string::npos )
{
qDebug() << "Forcing your /resource to contain 'tomahawk' (the google workaround)";
m_jid.setResource( "tomahawk-tomahawk" );
}
}
m_client = QSharedPointer<gloox::Client>( new gloox::Client( m_jid, password.toStdString(), port ) );
m_server = server;
}
@@ -525,11 +513,10 @@ Jabber_p::handlePresence( const gloox::Presence& presence )
// ignore anyone not running tomahawk:
// convert to QString to get proper regex support
const gloox::Capabilities *caps = presence.findExtension<gloox::Capabilities>(gloox::ExtCaps);
const gloox::Capabilities *caps = presence.findExtension<gloox::Capabilities>( gloox::ExtCaps );
QString node = QString::fromAscii( caps->node().c_str() );
if( QString::fromAscii( jid.resource().c_str() ).startsWith(QLatin1String("tomahawk"))
|| node == TOMAHAWK_CAP_NODE_NAME
)
if( !QString::fromAscii( jid.resource().c_str() ).startsWith( QLatin1String( "tomahawk" ) )
&& !( node == TOMAHAWK_CAP_NODE_NAME ) )
{
//qDebug() << "not considering resource of" << res;
// Disco them to check if they are tomahawk-capable