mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-23 22:25:11 +02:00
Register presence handler in libsip_jabber
This commit is contained in:
@@ -122,6 +122,8 @@ Jabber_p::go()
|
||||
qDebug() << "No server found!";
|
||||
return;
|
||||
}
|
||||
|
||||
m_client->registerPresenceHandler( this );
|
||||
m_client->registerConnectionListener( this );
|
||||
m_client->logInstance().registerLogHandler( LogLevelWarning, LogAreaAll, this );
|
||||
m_client->registerMessageHandler( this );
|
||||
@@ -511,8 +513,11 @@ Jabber_p::handlePresence( const gloox::Presence& presence )
|
||||
|
||||
// ignore anyone not running tomahawk:
|
||||
// convert to QString to get proper regex support
|
||||
QString node;
|
||||
const gloox::Capabilities *caps = presence.findExtension<gloox::Capabilities>( gloox::ExtCaps );
|
||||
if( caps )
|
||||
QString node = QString::fromAscii( caps->node().c_str() );
|
||||
|
||||
if( !QString::fromAscii( jid.resource().c_str() ).startsWith( QLatin1String( "tomahawk" ) )
|
||||
&& !( node == TOMAHAWK_CAP_NODE_NAME ) )
|
||||
{
|
||||
|
Reference in New Issue
Block a user