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