|
|
| |
void AIMContact::userInfoUpdated( const QString& contact, const UserDetails& details ) | void AIMContact::userInfoUpdated( const QString& contact, const UserDetails& details ) |
{ | { |
if ( contact.lower() != contactId().lower() ) |
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) |
return; | return; |
| |
kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << contact << endl; | kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << contact << endl; |
|
|
| |
void AIMContact::userOnline( const QString& userId ) | void AIMContact::userOnline( const QString& userId ) |
{ | { |
if ( userId.lower() == contactId().lower() ) |
if ( Oscar::normalize( userId ) == Oscar::normalize( contactId() ) ) |
{ | { |
kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Getting more contact info" << endl; | kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Getting more contact info" << endl; |
setOnlineStatus( mProtocol->statusOnline ); | setOnlineStatus( mProtocol->statusOnline ); |
|
|
| |
void AIMContact::updateAwayMessage( const QString& contact, const QString& message ) | void AIMContact::updateAwayMessage( const QString& contact, const QString& message ) |
{ | { |
if ( contact.lower() != contactId().lower() ) |
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) |
return; | return; |
else | else |
{ | { |
|
|
| |
void AIMContact::updateProfile( const QString& contact, const QString& profile ) | void AIMContact::updateProfile( const QString& contact, const QString& profile ) |
{ | { |
if ( contact.lower() != contactId().lower() ) |
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) |
return; | return; |
| |
setProperty( mProtocol->clientProfile, profile ); | setProperty( mProtocol->clientProfile, profile ); |
|
|
| |
void ICQContact::userOnline( const QString& userId ) | void ICQContact::userOnline( const QString& userId ) |
{ | { |
if ( userId != contactId() ) |
if ( Oscar::normalize( userId ) != Oscar::normalize( contactId() ) ) |
return; | return; |
| |
kdDebug(OSCAR_ICQ_DEBUG) << "Setting " << userId << " online" << endl; | kdDebug(OSCAR_ICQ_DEBUG) << "Setting " << userId << " online" << endl; |
|
|
| |
void ICQContact::userOffline( const QString& userId ) | void ICQContact::userOffline( const QString& userId ) |
{ | { |
if ( userId != contactId() ) |
if ( Oscar::normalize( userId ) != Oscar::normalize( contactId() ) ) |
return; | return; |
| |
kdDebug(OSCAR_ICQ_DEBUG) << "Setting " << userId << " offline" << endl; | kdDebug(OSCAR_ICQ_DEBUG) << "Setting " << userId << " offline" << endl; |
|
|
setOnlineStatus( mProtocol->statusManager()->waitingForAuth() ); | setOnlineStatus( mProtocol->statusManager()->waitingForAuth() ); |
| |
QString nickname = property( Kopete::Global::Properties::self()->nickName() ).value().toString(); | QString nickname = property( Kopete::Global::Properties::self()->nickName() ).value().toString(); |
if ( nickname.isEmpty() || nickname == contactId() ) |
if ( nickname.isEmpty() || Oscar::normalize( nickname ) == Oscar::normalize( contactId() ) ) |
{ | { |
int time = ( KApplication::random() % 25 ) * 1000; | int time = ( KApplication::random() % 25 ) * 1000; |
kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "updating nickname in " << time/1000 << " seconds" << endl; | kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "updating nickname in " << time/1000 << " seconds" << endl; |
|
|
| |
void ICQContact::slotGotAuthReply( const QString& contact, const QString& reason, bool granted ) | void ICQContact::slotGotAuthReply( const QString& contact, const QString& reason, bool granted ) |
{ | { |
if ( contact != contactId() ) |
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) |
return; | return; |
| |
kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << endl; | kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << endl; |
|
|
| |
void ICQContact::slotGotAuthRequest( const QString& contact, const QString& reason ) | void ICQContact::slotGotAuthRequest( const QString& contact, const QString& reason ) |
{ | { |
if ( contact != contactId() ) |
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) |
return; | return; |
| |
ICQAuthReplyDialog replyDialog; | ICQAuthReplyDialog replyDialog; |
|
|
| |
void ICQContact::receivedLongInfo( const QString& contact ) | void ICQContact::receivedLongInfo( const QString& contact ) |
{ | { |
if ( contact.lower() != contactId().lower() ) |
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) |
{ | { |
if ( m_infoWidget ) | if ( m_infoWidget ) |
m_infoWidget->delayedDestruct(); | m_infoWidget->delayedDestruct(); |
|
|
| |
void ICQContact::receivedShortInfo( const QString& contact ) | void ICQContact::receivedShortInfo( const QString& contact ) |
{ | { |
if ( contact != contactId() ) |
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) |
return; | return; |
| |
ICQShortInfo shortInfo = mAccount->engine()->getShortInfo( contact ); | ICQShortInfo shortInfo = mAccount->engine()->getShortInfo( contact ); |
|
|
#include "transfer.h" | #include "transfer.h" |
#include "buffer.h" | #include "buffer.h" |
#include "connection.h" | #include "connection.h" |
|
#include "oscarutils.h" |
| |
#include <kdebug.h> | #include <kdebug.h> |
| |
|
|
{ | { |
Buffer* buf = transfer()->buffer(); | Buffer* buf = transfer()->buffer(); |
| |
QString uin = buf->getBUIN(); |
QString uin = Oscar::normalize( buf->getBUIN() ); |
QString reason = buf->getBSTR(); | QString reason = buf->getBSTR(); |
| |
buf->getWord(); // 0x0000 - Unknown | buf->getWord(); // 0x0000 - Unknown |
|
|
{ | { |
Buffer* buf = transfer()->buffer(); | Buffer* buf = transfer()->buffer(); |
| |
QString uin = buf->getBUIN(); |
QString uin = Oscar::normalize( buf->getBUIN() ); |
QString reason = buf->getBSTR(); | QString reason = buf->getBSTR(); |
| |
buf->getWord(); // 0x0000 - Unknown | buf->getWord(); // 0x0000 - Unknown |
|
|
{ | { |
Buffer* buf = transfer()->buffer(); | Buffer* buf = transfer()->buffer(); |
| |
QString uin = buf->getBUIN(); |
QString uin = Oscar::normalize( buf->getBUIN() ); |
bool accepted = buf->getByte(); | bool accepted = buf->getByte(); |
QString reason = buf->getBSTR(); | QString reason = buf->getBSTR(); |
| |
|
|
{ | { |
Buffer* buf = transfer()->buffer(); | Buffer* buf = transfer()->buffer(); |
| |
QString uin = buf->getBUIN(); |
QString uin = Oscar::normalize( buf->getBUIN() ); |
| |
kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "User " << uin << " added you to the contact list" << endl; | kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "User " << uin << " added you to the contact list" << endl; |
emit contactAddedYou( uin ); | emit contactAddedYou( uin ); |
|
|
tlvList.append( t ); | tlvList.append( t ); |
} | } |
| |
|
if ( itemType == ROSTER_CONTACT ) |
|
itemName = Oscar::normalize( itemName ); |
|
|
Oscar::SSI s( itemName, groupId, itemId, itemType, tlvList ); | Oscar::SSI s( itemName, groupId, itemId, itemType, tlvList ); |
s.setTLVListLength( tlvLength ); | s.setTLVListLength( tlvLength ); |
| |
|
|
{ | { |
} | } |
| |
void SSIModifyTask::onGo( ) |
void SSIModifyTask::onGo() |
{ | { |
sendSSIUpdate(); | sendSSIUpdate(); |
} | } |
|
|
{ | { |
m_opType = Add; | m_opType = Add; |
m_opSubject = Contact; | m_opSubject = Contact; |
Oscar::SSI oldItem = m_ssiManager->findContact( contact ); |
|
|
QString newContact = Oscar::normalize( contact ); |
|
|
|
Oscar::SSI oldItem = m_ssiManager->findContact( newContact ); |
Oscar::SSI groupItem = m_ssiManager->findGroup( group ); | Oscar::SSI groupItem = m_ssiManager->findGroup( group ); |
| |
if ( !groupItem ) | if ( !groupItem ) |
|
|
} | } |
| |
kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "creating new SSI item for " << contact << " in group " << group << endl; | kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "creating new SSI item for " << contact << " in group " << group << endl; |
Oscar::SSI newItem( contact, groupItem.gid(), m_ssiManager->nextContactId(), ROSTER_CONTACT, tlvList ); |
Oscar::SSI newItem( newContact, groupItem.gid(), m_ssiManager->nextContactId(), ROSTER_CONTACT, tlvList ); |
m_newItem = newItem; | m_newItem = newItem; |
return true; | return true; |
} | } |
|
|
{ | { |
m_opType = Remove; | m_opType = Remove; |
m_opSubject = Contact; | m_opSubject = Contact; |
m_oldItem = m_ssiManager->findContact( contact ); |
m_oldItem = m_ssiManager->findContact( Oscar::normalize( contact ) ); |
kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Scheduling" << m_oldItem.name() << " for removal" << endl; | kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Scheduling" << m_oldItem.name() << " for removal" << endl; |
return true; | return true; |
} | } |
|
|
{ | { |
m_opType = Change; | m_opType = Change; |
m_opSubject = Group; | m_opSubject = Group; |
m_oldItem = m_ssiManager->findContact( contact ); |
m_oldItem = m_ssiManager->findContact( Oscar::normalize( contact ) ); |
Oscar::SSI oldGroupItem; | Oscar::SSI oldGroupItem; |
if ( m_oldItem.isValid() ) | if ( m_oldItem.isValid() ) |
oldGroupItem = m_ssiManager->findGroup( newGroup ); | oldGroupItem = m_ssiManager->findGroup( newGroup ); |
|
|
return true; | return true; |
} | } |
| |
bool SSIModifyTask::removeGroup( const QString & groupName ) |
bool SSIModifyTask::removeGroup( const QString& groupName ) |
{ | { |
m_opType = Remove; | m_opType = Remove; |
m_opSubject = Group; | m_opSubject = Group; |