mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-22 08:49:42 +01:00
Add contactId to PeerInfo and use it as connection name/dbfriendlyname
This commit is contained in:
parent
76b21e3742
commit
537336adac
src
@ -973,6 +973,7 @@ XmppSipPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Type pr
|
||||
m_peers[ jid ] = presenceType;
|
||||
|
||||
Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, fulljid, PeerInfo::AutoCreate );
|
||||
peerInfo->setContactId( jid.bare() );
|
||||
peerInfo->setStatus( PeerInfo::Online );
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
|
@ -334,7 +334,7 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo )
|
||||
ControlConnection* conn = new ControlConnection( this );
|
||||
|
||||
const QString& nodeid = Database::instance()->impl()->dbid();
|
||||
conn->setName( peerId.left( peerId.indexOf( "/" ) ) );
|
||||
conn->setName( peerInfo->contactId() );
|
||||
conn->setId( nodeid );
|
||||
conn->addPeerInfo( peerInfo );
|
||||
|
||||
@ -759,7 +759,7 @@ Servent::connectToPeer( const peerinfo_ptr& peerInfo )
|
||||
conn->setFirstMessage( m );
|
||||
|
||||
if ( peerInfo->id().length() )
|
||||
conn->setName( peerInfo->id() );
|
||||
conn->setName( peerInfo->contactId() );
|
||||
if ( sipInfo.nodeId().length() )
|
||||
conn->setId( sipInfo.nodeId() );
|
||||
|
||||
|
@ -201,6 +201,20 @@ PeerInfo::debugName() const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PeerInfo::setContactId ( const QString& contactId )
|
||||
{
|
||||
m_contactId = contactId;
|
||||
}
|
||||
|
||||
|
||||
const QString
|
||||
PeerInfo::contactId() const
|
||||
{
|
||||
return m_contactId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
PeerInfo::setStatus( PeerInfo::Status status )
|
||||
|
@ -86,7 +86,13 @@ public:
|
||||
void setType( Tomahawk::PeerInfo::Type type );
|
||||
PeerInfo::Type type() const;
|
||||
|
||||
// actual data
|
||||
/* actual data */
|
||||
|
||||
// while peerId references a certain peer, contact id references the contact
|
||||
// e.g. a peerId might be a full jid with resource while contact id is the bare jid
|
||||
void setContactId( const QString& contactId );
|
||||
const QString contactId() const;
|
||||
|
||||
void setStatus( Status status );
|
||||
Status status() const;
|
||||
|
||||
@ -122,6 +128,7 @@ private:
|
||||
PeerInfo::Type m_type;
|
||||
|
||||
QString m_id;
|
||||
QString m_contactId;
|
||||
Status m_status;
|
||||
SipInfo m_sipInfo;
|
||||
QString m_friendlyName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user