mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 07:07:05 +02:00
Fix all the style issues!
This commit is contained in:
@@ -435,7 +435,7 @@ XmppSipPlugin::errorMessage( Jreen::Client::DisconnectReason reason )
|
|||||||
void
|
void
|
||||||
XmppSipPlugin::sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const SipInfo& info )
|
XmppSipPlugin::sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const SipInfo& info )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << receiver << info;
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << receiver << info;
|
||||||
|
|
||||||
if ( !m_client )
|
if ( !m_client )
|
||||||
return;
|
return;
|
||||||
|
@@ -306,7 +306,7 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo )
|
|||||||
peerInfoDebug(peerInfo) << "YAY, we need to establish the connection now.. thinking";
|
peerInfoDebug(peerInfo) << "YAY, we need to establish the connection now.. thinking";
|
||||||
if ( !connectedToSession( peerInfo->sipInfo().uniqname() ) )
|
if ( !connectedToSession( peerInfo->sipInfo().uniqname() ) )
|
||||||
{
|
{
|
||||||
Servent::instance()->connectToPeer( peerInfo );
|
connectToPeer( peerInfo );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -328,21 +328,21 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SipInfo info;
|
SipInfo info;
|
||||||
if( Servent::instance()->visibleExternally() )
|
if( visibleExternally() )
|
||||||
{
|
{
|
||||||
QString peerId = peerInfo->id();
|
QString peerId = peerInfo->id();
|
||||||
QString key = uuid();
|
QString key = uuid();
|
||||||
ControlConnection* conn = new ControlConnection( Servent::instance() );
|
ControlConnection* conn = new ControlConnection( this );
|
||||||
|
|
||||||
const QString& nodeid = Database::instance()->impl()->dbid();
|
const QString& nodeid = Database::instance()->impl()->dbid();
|
||||||
conn->setName( peerId.left( peerId.indexOf( "/" ) ) );
|
conn->setName( peerId.left( peerId.indexOf( "/" ) ) );
|
||||||
conn->setId( nodeid );
|
conn->setId( nodeid );
|
||||||
conn->addPeerInfo( peerInfo );
|
conn->addPeerInfo( peerInfo );
|
||||||
|
|
||||||
Servent::instance()->registerOffer( key, conn );
|
registerOffer( key, conn );
|
||||||
info.setVisible( true );
|
info.setVisible( true );
|
||||||
info.setHost( Servent::instance()->externalAddress() );
|
info.setHost( externalAddress() );
|
||||||
info.setPort( Servent::instance()->externalPort() );
|
info.setPort( externalPort() );
|
||||||
info.setKey( key );
|
info.setKey( key );
|
||||||
info.setUniqname( nodeid );
|
info.setUniqname( nodeid );
|
||||||
|
|
||||||
@@ -389,13 +389,13 @@ void Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo )
|
|||||||
*/
|
*/
|
||||||
if ( info.isVisible() )
|
if ( info.isVisible() )
|
||||||
{
|
{
|
||||||
if( !Servent::instance()->visibleExternally() ||
|
if( !visibleExternally() ||
|
||||||
Servent::instance()->externalAddress() < info.host() ||
|
externalAddress() < info.host() ||
|
||||||
( Servent::instance()->externalAddress() == info.host() && Servent::instance()->externalPort() < info.port() ) )
|
( externalAddress() == info.host() && externalPort() < info.port() ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
tDebug() << "Initiate connection to" << peerInfo->id() << "at" << info.host() << " peer of: " << peerInfo->sipPlugin()->account()->accountFriendlyName();
|
tDebug() << "Initiate connection to" << peerInfo->id() << "at" << info.host() << " peer of: " << peerInfo->sipPlugin()->account()->accountFriendlyName();
|
||||||
Servent::instance()->connectToPeer( peerInfo );
|
connectToPeer( peerInfo );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -716,12 +716,12 @@ Servent::connectToPeer( const peerinfo_ptr& peerInfo )
|
|||||||
|
|
||||||
foreach( const peerinfo_ptr& currentPeerInfo, c->peerInfos() )
|
foreach( const peerinfo_ptr& currentPeerInfo, c->peerInfos() )
|
||||||
{
|
{
|
||||||
tLog() << "peerInfo:" << currentPeerInfo->debugName() << "same object: " << (peerInfo == currentPeerInfo) << (peerInfo.data() == currentPeerInfo.data()) << (peerInfo->debugName() == currentPeerInfo->debugName());
|
peerInfoDebug( currentPeerInfo ) << "Same object: " << ( peerInfo == currentPeerInfo ) << ( peerInfo.data() == currentPeerInfo.data() ) << ( peerInfo->debugName() == currentPeerInfo->debugName() );
|
||||||
|
|
||||||
if(peerInfo == currentPeerInfo)
|
if(peerInfo == currentPeerInfo)
|
||||||
{
|
{
|
||||||
isDupe = true;
|
isDupe = true;
|
||||||
tLog() << "Not adding " << peerInfo->debugName() << ", because it's a dupe: peerInfoCount remains " << conn->peerInfos().count();
|
peerInfoDebug( currentPeerInfo ) << "Not adding, because it's a dupe: peerInfoCount remains the same " << conn->peerInfos().count();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -883,6 +883,7 @@ Servent::claimOffer( ControlConnection* cc, const QString &nodeid, const QString
|
|||||||
conn->setName( peer.toString() );
|
conn->setName( peer.toString() );
|
||||||
|
|
||||||
Tomahawk::Accounts::Account* account = Tomahawk::Accounts::AccountManager::instance()->zeroconfAccount();
|
Tomahawk::Accounts::Account* account = Tomahawk::Accounts::AccountManager::instance()->zeroconfAccount();
|
||||||
|
|
||||||
// if we get this connection the account should exist and be enabled
|
// if we get this connection the account should exist and be enabled
|
||||||
Q_ASSERT( account );
|
Q_ASSERT( account );
|
||||||
Q_ASSERT( account->enabled() );
|
Q_ASSERT( account->enabled() );
|
||||||
|
@@ -265,8 +265,7 @@ bool operator==( const SipInfo& one, const SipInfo& two )
|
|||||||
&& one.host() == two.host()
|
&& one.host() == two.host()
|
||||||
&& one.port() == two.port()
|
&& one.port() == two.port()
|
||||||
&& one.uniqname() == two.uniqname()
|
&& one.uniqname() == two.uniqname()
|
||||||
&& one.key() == two.key()
|
&& one.key() == two.key() )
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user