mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-21 21:25:52 +02:00
* Always set current name as friendlyname.
This commit is contained in:
@@ -134,6 +134,8 @@ ControlConnection::setup()
|
|||||||
else
|
else
|
||||||
friendlyName = name();
|
friendlyName = name();
|
||||||
|
|
||||||
|
tDebug() << "Detected name:" << name() << friendlyName << m_sock->peerAddress();
|
||||||
|
|
||||||
// setup source and remote collection for this peer
|
// setup source and remote collection for this peer
|
||||||
m_source = SourceList::instance()->get( id(), friendlyName );
|
m_source = SourceList::instance()->get( id(), friendlyName );
|
||||||
m_source->setControlConnection( this );
|
m_source->setControlConnection( this );
|
||||||
|
@@ -818,11 +818,11 @@ Servent::isIPWhitelisted( QHostAddress ip )
|
|||||||
static QList<range> whitelist;
|
static QList<range> whitelist;
|
||||||
if( whitelist.isEmpty() )
|
if( whitelist.isEmpty() )
|
||||||
{
|
{
|
||||||
whitelist << range( QHostAddress( "10.0.0.0" ), 8 )
|
whitelist << range( QHostAddress( "10.0.0.0" ), 8 )
|
||||||
<< range( QHostAddress( "172.16.0.0" ), 12 )
|
<< range( QHostAddress( "172.16.0.0" ), 12 )
|
||||||
<< range( QHostAddress( "192.168.0.0" ), 16 )
|
<< range( QHostAddress( "192.168.0.0" ), 16 )
|
||||||
<< range( QHostAddress( "169.254.0.0" ), 16 )
|
<< range( QHostAddress( "169.254.0.0" ), 16 )
|
||||||
<< range( QHostAddress( "127.0.0.0" ), 24 );
|
<< range( QHostAddress( "127.0.0.0" ), 24 );
|
||||||
|
|
||||||
// tDebug( LOGVERBOSE ) << "Loaded whitelist IP range:" << whitelist;
|
// tDebug( LOGVERBOSE ) << "Loaded whitelist IP range:" << whitelist;
|
||||||
}
|
}
|
||||||
|
@@ -478,14 +478,7 @@ SipHandler::onPeerOnline( const QString& jid )
|
|||||||
ControlConnection* conn = new ControlConnection( Servent::instance(), QString() );
|
ControlConnection* conn = new ControlConnection( Servent::instance(), QString() );
|
||||||
|
|
||||||
const QString& nodeid = Database::instance()->dbid();
|
const QString& nodeid = Database::instance()->dbid();
|
||||||
|
conn->setName( jid.left( jid.indexOf( "/" ) ) );
|
||||||
//TODO: this is a terrible assumption, help me clean this up, mighty muesli!
|
|
||||||
if ( jid.contains( "@conference.") )
|
|
||||||
conn->setName( jid );
|
|
||||||
else
|
|
||||||
conn->setName( jid.left( jid.indexOf( "/" ) ) );
|
|
||||||
|
|
||||||
tDebug() << "Set name on connection:" << conn->name();
|
|
||||||
conn->setId( nodeid );
|
conn->setId( nodeid );
|
||||||
|
|
||||||
Servent::instance()->registerOffer( key, conn );
|
Servent::instance()->registerOffer( key, conn );
|
||||||
|
@@ -200,7 +200,7 @@ Source::setOnline()
|
|||||||
emit online();
|
emit online();
|
||||||
|
|
||||||
// ensure username is in the database
|
// ensure username is in the database
|
||||||
DatabaseCommand_addSource* cmd = new DatabaseCommand_addSource( m_username, m_friendlyname );
|
DatabaseCommand_addSource* cmd = new DatabaseCommand_addSource( m_username, friendlyName() );
|
||||||
connect( cmd, SIGNAL( done( unsigned int, QString ) ),
|
connect( cmd, SIGNAL( done( unsigned int, QString ) ),
|
||||||
SLOT( dbLoaded( unsigned int, const QString& ) ) );
|
SLOT( dbLoaded( unsigned int, const QString& ) ) );
|
||||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||||
|
@@ -96,6 +96,7 @@ SourceList::setSources( const QList<Tomahawk::source_ptr>& sources )
|
|||||||
|
|
||||||
tLog() << Q_FUNC_INFO << "- Total sources now:" << m_sources.size();
|
tLog() << Q_FUNC_INFO << "- Total sources now:" << m_sources.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
emit ready();
|
emit ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +201,10 @@ SourceList::get( const QString& username, const QString& friendlyName )
|
|||||||
add( source );
|
add( source );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
source = m_sources.value( username );
|
source = m_sources.value( username );
|
||||||
|
source->setFriendlyName( friendlyName );
|
||||||
|
}
|
||||||
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
@@ -94,7 +94,6 @@ JabberPlugin::JabberPlugin( const QString& pluginId )
|
|||||||
connect( m_ui->jabberUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
|
connect( m_ui->jabberUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// setup JID object
|
// setup JID object
|
||||||
Jreen::JID jid = Jreen::JID( accountName() );
|
Jreen::JID jid = Jreen::JID( accountName() );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user