void AIMContact::userInfoUpdated( const QString& contact, const UserDetails& details ) { if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) return; kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << contact << endl; //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 ); ( details.userClass() & CLASS_WIRELESS ) ? m_mobile = true : m_mobile = false; if ( ( details.userClass() & CLASS_AWAY ) == STATUS_ONLINE ) { if ( m_mobile ) { kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Contact: " << contact << " is mobile-online." << endl; setOnlineStatus( mProtocol->statusWirelessOnline ); } else { kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Contact: " << contact << " is online." << endl; setOnlineStatus( mProtocol->statusOnline ); //we're online } removeProperty( mProtocol->awayMessage ); m_haveAwayMessage = false; } else if ( ( details.userClass() & CLASS_AWAY ) ) // STATUS_AWAY { if ( m_mobile ) { kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Contact: " << contact << " is mobile-away." << endl; setOnlineStatus( mProtocol->statusWirelessOnline ); } else { kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Contact: " << contact << " is away." << endl; setOnlineStatus( mProtocol->statusAway ); //we're away } if ( !m_haveAwayMessage ) //prevent cyclic away message requests { mAccount->engine()->requestAIMAwayMessage( contactId() ); m_haveAwayMessage = true; } } else { kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Contact: " << contact << " class " << details.userClass() << " is unhandled... defaulting to away." << endl; setOnlineStatus( mProtocol->statusAway ); //we're away if ( !m_haveAwayMessage ) //prevent cyclic away message requests { mAccount->engine()->requestAIMAwayMessage( contactId() ); m_haveAwayMessage = true; } } if ( details.buddyIconHash().size() > 0 && details.buddyIconHash() != m_details.buddyIconHash() ) { if ( !mAccount->engine()->hasIconConnection() ) mAccount->engine()->requestServerRedirect( 0x0010 ); int time = ( KApplication::random() % 10 ) * 1000; kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "updating buddy icon in " << time/1000 << " seconds" << endl; QTimer::singleShot( time, this, SLOT( requestBuddyIcon() ) ); } OscarContact::userInfoUpdated( contact, details ); }
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 ); }
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 ); }