예제 #1
0
파일: SipInfo.cpp 프로젝트: Nskif/tomahawk
bool
operator==( const SipInfo& one, const SipInfo& two )
{
    // check valid/invalid combinations first, so we don't try to access any invalid sipInfos (->assert)
    if ( ( one.isValid() && !two.isValid() ) || ( !one.isValid() && two.isValid() ) )
    {
        return false;
    }
    else if ( one.isValid() && two.isValid() )
    {
        if ( one.isVisible() == two.isVisible()
            && one.host() == two.host()
            && one.port() == two.port()
            && one.nodeId() == two.nodeId()
            && one.key() == two.key() )
        {
            return true;
        }
    }

    return false;
}
예제 #2
0
void
XmppSipPlugin::sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const SipInfo& info )
{
    tDebug( LOGVERBOSE ) << Q_FUNC_INFO << receiver << info;

    if ( !m_client )
        return;

    TomahawkXmppMessage *sipMessage;
    if ( info.isVisible() )
    {
        sipMessage = new TomahawkXmppMessage( info.host(), info.port(), info.nodeId(), info.key() );
    }
    else
        sipMessage = new TomahawkXmppMessage();

    qDebug() << "Send sip messsage to" << receiver;
    Jreen::IQ iq( Jreen::IQ::Set, receiver->id() );
    iq.addExtension( sipMessage );
    Jreen::IQReply *reply = m_client->send( iq );
    reply->setData( SipMessageSent );
    connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
}