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 ); }
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 ) ); }
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 ); }
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)) ); }
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 ); }