mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Keep track of offered dbid to a peer and check offer key to make sure it matches
This commit is contained in:
@@ -536,11 +536,14 @@ TwitterPlugin::registerOffer( const QString &screenName, const QHash< QString, Q
|
|||||||
_peerData.remove( "resend" );
|
_peerData.remove( "resend" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !_peerData.contains( "okey" ) )
|
if ( !_peerData.contains( "okey" ) ||
|
||||||
|
!_peerData.contains( "onod" ) ||
|
||||||
|
( _peerData.contains( "onod" ) && _peerData["onod"] != Database::instance()->dbid() ) )
|
||||||
{
|
{
|
||||||
QString okey = QUuid::createUuid().toString().split( '-' ).last();
|
QString okey = QUuid::createUuid().toString().split( '-' ).last();
|
||||||
okey.chop( 1 );
|
okey.chop( 1 );
|
||||||
_peerData["okey"] = QVariant::fromValue< QString >( okey );
|
_peerData["okey"] = QVariant::fromValue< QString >( okey );
|
||||||
|
_peerData["onod"] = QVariant::fromValue< QString >( Database::instance()->dbid() );
|
||||||
peersChanged = true;
|
peersChanged = true;
|
||||||
needToAddToCache = true;
|
needToAddToCache = true;
|
||||||
needToSend = true;
|
needToSend = true;
|
||||||
|
Reference in New Issue
Block a user