1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

* Some XmppSip cleanup.

This commit is contained in:
Christian Muehlhaeuser
2013-01-28 12:30:51 +01:00
parent 03fd8cc6fd
commit fb4a22d305

View File

@@ -120,7 +120,7 @@ XmppSipPlugin::XmppSipPlugin( Account* account )
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
// instantiate XmlConsole // instantiate XmlConsole
if( readXmlConsoleEnabled() ) if ( readXmlConsoleEnabled() )
{ {
m_xmlConsole = new XmlConsole( m_client ); m_xmlConsole = new XmlConsole( m_client );
m_xmlConsole->show(); m_xmlConsole->show();
@@ -192,6 +192,7 @@ XmppSipPlugin::~XmppSipPlugin()
delete m_client; delete m_client;
} }
QString QString
XmppSipPlugin::inviteString() const XmppSipPlugin::inviteString() const
{ {
@@ -463,7 +464,7 @@ XmppSipPlugin::addContact( const QString& jid, const QString& msg )
{ {
// Add contact to the Tomahawk group on the roster // Add contact to the Tomahawk group on the roster
QStringList jidParts = jid.split( '@' ); QStringList jidParts = jid.split( '@' );
if( jidParts.count() == 2 && !jidParts[0].trimmed().isEmpty() && !jidParts[1].trimmed().isEmpty() ) if ( jidParts.count() == 2 && !jidParts[0].trimmed().isEmpty() && !jidParts[1].trimmed().isEmpty() )
{ {
m_roster->subscribe( jid, msg, jid, QStringList() << "Tomahawk" ); m_roster->subscribe( jid, msg, jid, QStringList() << "Tomahawk" );
emit inviteSentSuccess( jid ); emit inviteSentSuccess( jid );
@@ -869,7 +870,7 @@ XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
QString versionString = QString( "%1 %2 %3" ).arg( softwareVersion->name(), softwareVersion->os(), softwareVersion->version() ); QString versionString = QString( "%1 %2 %3" ).arg( softwareVersion->name(), softwareVersion->os(), softwareVersion->version() );
qDebug() << Q_FUNC_INFO << "Received software version for" << iq.from().full() << ":" << versionString; qDebug() << Q_FUNC_INFO << "Received software version for" << iq.from().full() << ":" << versionString;
Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, iq.from().full() ); Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, iq.from().full() );
if( !peerInfo.isNull() ) if ( !peerInfo.isNull() )
{ {
peerInfo->setVersionString( versionString ); peerInfo->setVersionString( versionString );
} }
@@ -879,18 +880,18 @@ XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
{ {
qDebug() << "Sent IQ(Set), what should be happening here?"; qDebug() << "Sent IQ(Set), what should be happening here?";
} }
else if( context == SipMessageSent ) else if ( context == SipMessageSent )
{ {
qDebug() << "Sent SipMessage... what now?!"; qDebug() << "Sent SipMessage... what now?!";
} }
/*else if(context == RequestedVCard ) /*else if ( context == RequestedVCard )
{ {
qDebug() << "Requested VCard... what now?!"; qDebug() << "Requested VCard... what now?!";
}*/ }*/
else else
{ {
TomahawkXmppMessage::Ptr sipMessage = iq.payload< TomahawkXmppMessage >(); TomahawkXmppMessage::Ptr sipMessage = iq.payload< TomahawkXmppMessage >();
if(sipMessage) if ( sipMessage )
{ {
iq.accept(); iq.accept();
@@ -911,7 +912,7 @@ XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
qDebug() << Q_FUNC_INFO << "From:" << iq.from().full() << ":" << info; qDebug() << Q_FUNC_INFO << "From:" << iq.from().full() << ":" << info;
Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, iq.from().full() ); Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, iq.from().full() );
if( peerInfo.isNull() ) if ( peerInfo.isNull() )
{ {
tDebug() << Q_FUNC_INFO << "no valid peerInfo for " << iq.from().full(); tDebug() << Q_FUNC_INFO << "no valid peerInfo for " << iq.from().full();
return; return;
@@ -944,7 +945,7 @@ XmppSipPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Type pr
{ {
QString fulljid = jid.full(); QString fulljid = jid.full();
if( fulljid.contains( "public.talk.google.com" ) ) if ( fulljid.contains( "public.talk.google.com" ) )
return; return;
// "going offline" event // "going offline" event
@@ -956,7 +957,7 @@ XmppSipPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Type pr
m_peers[ jid ] = presenceType; m_peers[ jid ] = presenceType;
Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, fulljid ); Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, fulljid );
if( !peerInfo.isNull() ) if ( !peerInfo.isNull() )
{ {
peerInfo->setStatus( PeerInfo::Offline ); peerInfo->setStatus( PeerInfo::Offline );
} }
@@ -1013,7 +1014,7 @@ XmppSipPlugin::onNewAvatar( const QString& jid )
if ( peer.bare() == jid ) if ( peer.bare() == jid )
{ {
Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, peer.full() ); Tomahawk::peerinfo_ptr peerInfo = PeerInfo::get( this, peer.full() );
if( !peerInfo.isNull() ) if ( !peerInfo.isNull() )
peerInfo->setAvatar( m_avatarManager->avatar( jid ) ); peerInfo->setAvatar( m_avatarManager->avatar( jid ) );
} }
} }