diff --git a/src/libtomahawk/AclRegistry.cpp b/src/libtomahawk/AclRegistry.cpp index dedd8bc25..ef99879fb 100644 --- a/src/libtomahawk/AclRegistry.cpp +++ b/src/libtomahawk/AclRegistry.cpp @@ -291,3 +291,12 @@ ACLRegistry::save() } TomahawkSettings::instance()->setAclEntries( entryList ); } + + +void +ACLRegistry::wipeEntries() +{ + tLog() << Q_FUNC_INFO; + m_cache.clear(); + save(); +} diff --git a/src/libtomahawk/AclRegistry.h b/src/libtomahawk/AclRegistry.h index 05c4c7435..37011ec48 100644 --- a/src/libtomahawk/AclRegistry.h +++ b/src/libtomahawk/AclRegistry.h @@ -102,11 +102,14 @@ public slots: #ifndef ENABLE_HEADLESS void getUserDecision( ACLRegistry::User user, const QString &username ); - +#endif + private slots: +#ifndef ENABLE_HEADLESS void userDecision( ACLRegistry::User user ); void queueNextJob(); #endif + void wipeEntries(); private: /** diff --git a/src/libtomahawk/network/Connection.cpp b/src/libtomahawk/network/Connection.cpp index 286965d88..def888eee 100644 --- a/src/libtomahawk/network/Connection.cpp +++ b/src/libtomahawk/network/Connection.cpp @@ -200,9 +200,10 @@ Connection::checkACL() } QString nodeid = property( "nodeid" ).toString(); + QString barePeerId = nodeid.left( nodeid.indexOf( "/" ) ); tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Checking ACL for" << name(); connect( ACLRegistry::instance(), SIGNAL( aclResult( QString, QString, ACLRegistry::ACL ) ), this, SLOT( checkACLResult( QString, QString, ACLRegistry::ACL ) ), Qt::QueuedConnection ); - QMetaObject::invokeMethod( ACLRegistry::instance(), "isAuthorizedUser", Qt::QueuedConnection, Q_ARG( QString, nodeid ), Q_ARG( QString, name() ), Q_ARG( ACLRegistry::ACL, ACLRegistry::NotFound ) ); + QMetaObject::invokeMethod( ACLRegistry::instance(), "isAuthorizedUser", Qt::QueuedConnection, Q_ARG( QString, barePeerId ), Q_ARG( QString, name() ), Q_ARG( ACLRegistry::ACL, ACLRegistry::NotFound ) ); } diff --git a/src/libtomahawk/sip/SipHandler.cpp b/src/libtomahawk/sip/SipHandler.cpp index d4816c651..4044ddd6d 100644 --- a/src/libtomahawk/sip/SipHandler.cpp +++ b/src/libtomahawk/sip/SipHandler.cpp @@ -171,6 +171,9 @@ SipHandler::onSipInfo( const QString& peerId, const SipInfo& info ) QString barePeerId = peerId.left( peerId.indexOf( "/" ) ); + //FIXME: We should probably be using barePeerId in the connectToPeer call below. + //But, verify this doesn't cause any problems (there is still a uniquename after all) + /* If only one party is externally visible, connection is obvious If both are, peer with lowest IP address initiates the connection. @@ -181,11 +184,11 @@ SipHandler::onSipInfo( const QString& peerId, const SipInfo& info ) if( !Servent::instance()->visibleExternally() || Servent::instance()->externalAddress() <= info.host().hostName() ) { - qDebug() << "Initiate connection to" << barePeerId; + qDebug() << "Initiate connection to" << peerId; Servent::instance()->connectToPeer( info.host().hostName(), info.port(), info.key(), - barePeerId, + peerId, info.uniqname() ); } else