1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 23:39:42 +01:00

Start on acl entry clearing; also change where we strip the JID

This commit is contained in:
Jeff Mitchell 2012-06-18 00:22:06 -04:00
parent 8603667270
commit f1a0de0f53
4 changed files with 20 additions and 4 deletions

View File

@ -291,3 +291,12 @@ ACLRegistry::save()
}
TomahawkSettings::instance()->setAclEntries( entryList );
}
void
ACLRegistry::wipeEntries()
{
tLog() << Q_FUNC_INFO;
m_cache.clear();
save();
}

View File

@ -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:
/**

View File

@ -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 ) );
}

View File

@ -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