コード例 #1
0
void AIMContact::userInfoUpdated( const QString& contact, const UserDetails& details )
{
    if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
        return;

    kDebug(OSCAR_ICQ_DEBUG) << contact;

    //if they don't have an SSI alias, make sure we use the capitalization from the
    //server so their contact id looks all pretty.
    QString nickname = property( Kopete::Global::Properties::self()->nickName() ).value().toString();
    if ( nickname.isEmpty() || Oscar::normalize( nickname ) == Oscar::normalize( contact ) )
        setNickName( contact );

    kDebug( OSCAR_ICQ_DEBUG ) << "extendedStatus is " << details.extendedStatus();
    Oscar::Presence presence = mProtocol->statusManager()->presenceOf( details.extendedStatus(), details.userClass() );
    setPresenceTarget( presence );

    m_mobile = ( presence.flags() & Oscar::Presence::Wireless );

    setAwayMessage( details.personalMessage() );
    if ( presence.type() != Oscar::Presence::Online && m_details.awaySinceTime() < details.awaySinceTime() ) //prevent cyclic away message requests
    {
        mAccount->engine()->requestAIMAwayMessage( contactId() );
    }

    OscarContact::userInfoUpdated( contact, details );
}
コード例 #2
0
void AIMContact::userOnline( const QString& userId )
{
	if ( Oscar::normalize( userId ) != Oscar::normalize( contactId() ) )
		return;

	kDebug(OSCAR_ICQ_DEBUG) << "Setting " << userId << " online";
	setPresenceTarget( Oscar::Presence( Oscar::Presence::Online, Oscar::Presence::AIM ) );
}
コード例 #3
0
void AIMContact::setSSIItem( const OContact& ssiItem )
{
	if ( ssiItem.type() != 0xFFFF && ssiItem.waitingAuth() == false &&
	     onlineStatus().status() == Kopete::OnlineStatus::Unknown )
	{
		//make sure they're offline
		setPresenceTarget( Oscar::Presence( Oscar::Presence::Offline, Oscar::Presence::AIM ) );
	}

	AIMContactBase::setSSIItem( ssiItem );
}
コード例 #4
0
AIMContact::AIMContact( Kopete::Account* account, const QString& name, Kopete::MetaContact* parent,
                        const QString& icon )
: AIMContactBase(account, name, parent, icon )
{
	mProtocol=static_cast<ICQProtocol *>(protocol());
	setPresenceTarget( Oscar::Presence( Oscar::Presence::Offline, Oscar::Presence::AIM ) );

	QObject::connect( mAccount->engine(), SIGNAL(receivedUserInfo(QString,UserDetails)),
	                  this, SLOT(userInfoUpdated(QString,UserDetails)) );
	QObject::connect( mAccount->engine(), SIGNAL(userIsOffline(QString)),
	                  this, SLOT(userOffline(QString)) );
}
コード例 #5
0
void AIMContact::userInfoUpdated( const QString& contact, const UserDetails& details )
{
	if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
		return;

	kDebug(OSCAR_ICQ_DEBUG) << contact;

	setNickName( contact );

	kDebug( OSCAR_ICQ_DEBUG ) << "extendedStatus is " << details.extendedStatus();
	Oscar::Presence presence = mProtocol->statusManager()->presenceOf( details.extendedStatus(), details.userClass() );
	setPresenceTarget( presence );

	m_mobile = ( presence.flags() & Oscar::Presence::Wireless );

	setAwayMessage( details.personalMessage() );
	if ( presence.type() != Oscar::Presence::Online && m_details.awaySinceTime() < details.awaySinceTime() ) //prevent cyclic away message requests
	{
		mAccount->engine()->requestAIMAwayMessage( contactId() );
	}

	OscarContact::userInfoUpdated( contact, details );
}