@ -32,7 +32,7 @@ namespace Konversation
AddressbookBase : : AddressbookBase ( )
{
K ABC: : StdAddressBook : : setAutomaticSave ( false ) ;
TDE ABC: : StdAddressBook : : setAutomaticSave ( false ) ;
m_ticket = NULL ;
}
@ -40,32 +40,32 @@ namespace Konversation
{
}
K ABC: : AddressBook * AddressbookBase : : getAddressBook ( ) { return addressBook ; }
TDE ABC: : AddressBook * AddressbookBase : : getAddressBook ( ) { return addressBook ; }
K ABC: : Addressee AddressbookBase : : getKABCAddresseeFromNick ( const TQString & ircnick , const TQString & servername , const TQString & servergroup )
TDE ABC: : Addressee AddressbookBase : : getKABCAddresseeFromNick ( const TQString & ircnick , const TQString & servername , const TQString & servergroup )
{
K ABC: : AddressBook : : Iterator it ;
TDE ABC: : AddressBook : : Iterator it ;
for ( it = addressBook - > begin ( ) ; it ! = addressBook - > end ( ) ; + + it )
{
if ( hasNick ( * it , ircnick , servername , servergroup ) )
return ( * it ) ;
}
return K ABC: : Addressee ( ) ;
return TDE ABC: : Addressee ( ) ;
}
K ABC: : Addressee AddressbookBase : : getKABCAddresseeFromNick ( const TQString & nick_server )
TDE ABC: : Addressee AddressbookBase : : getKABCAddresseeFromNick ( const TQString & nick_server )
{
K ABC: : AddressBook : : Iterator it ;
TDE ABC: : AddressBook : : Iterator it ;
for ( it = addressBook - > begin ( ) ; it ! = addressBook - > end ( ) ; + + it )
{
if ( hasNick ( * it , nick_server ) )
return ( * it ) ;
}
return K ABC: : Addressee ( ) ;
return TDE ABC: : Addressee ( ) ;
}
bool AddressbookBase : : hasNick ( const K ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
bool AddressbookBase : : hasNick ( const TDE ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
{
TQString lnick = ircnick . lower ( ) ;
@ -92,13 +92,13 @@ namespace Konversation
TQStringList AddressbookBase : : allContactsNicksForServer ( const TQString & servername , const TQString & servergroup )
{
TQStringList contacts ;
for ( K ABC: : AddressBook : : Iterator it = addressBook - > begin ( ) ; it ! = addressBook - > end ( ) ; + + it )
for ( TDE ABC: : AddressBook : : Iterator it = addressBook - > begin ( ) ; it ! = addressBook - > end ( ) ; + + it )
contacts + = getNicks ( * it , servername , servergroup ) ;
return contacts ;
}
TQStringList AddressbookBase : : getNicks ( const K ABC: : Addressee & addressee , const TQString & servername , const TQString & servergroup )
TQStringList AddressbookBase : : getNicks ( const TDE ABC: : Addressee & addressee , const TQString & servername , const TQString & servergroup )
{
TQStringList nicks ;
@ -121,7 +121,7 @@ namespace Konversation
return nicks ;
}
bool AddressbookBase : : hasNick ( const K ABC: : Addressee & addressee , const TQString & nick_server )
bool AddressbookBase : : hasNick ( const TDE ABC: : Addressee & addressee , const TQString & nick_server )
{
TQString lnick_server = nick_server . lower ( ) ;
TQStringList addresses = TQStringList : : split ( TQChar ( 0xE000 ) , addressee . custom ( " messaging/irc " , " All " ) ) ;
@ -136,7 +136,7 @@ namespace Konversation
}
TQString AddressbookBase : : getBestNick ( const K ABC: : Addressee & addressee )
TQString AddressbookBase : : getBestNick ( const TDE ABC: : Addressee & addressee )
{
//Look for a nickinfo for this nick, and use that. That way we turn a nick that is online.
NickInfoPtr nickInfo = getNickInfo ( addressee ) ;
@ -151,7 +151,7 @@ namespace Konversation
return TQString ( ) ;
}
NickInfoPtr AddressbookBase : : getNickInfo ( const K ABC: : Addressee & addressee )
NickInfoPtr AddressbookBase : : getNickInfo ( const TDE ABC: : Addressee & addressee )
{
NickInfoPtr lastNickInfo ;
TQStringList addresses = TQStringList : : split ( TQChar ( 0xE000 ) , addressee . custom ( " messaging/irc " , " All " ) ) ;
@ -175,11 +175,11 @@ namespace Konversation
return lastNickInfo ;
}
bool AddressbookBase : : hasAnyNicks ( const K ABC: : Addressee & addressee )
bool AddressbookBase : : hasAnyNicks ( const TDE ABC: : Addressee & addressee )
{
return ! addressee . custom ( " messaging/irc " , " All " ) . isEmpty ( ) ;
}
void AddressbookBase : : unassociateNick ( K ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
void AddressbookBase : : unassociateNick ( TDE ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
{
kdDebug ( ) < < " in unassociatenick for ' " < < ircnick < < endl ;
@ -239,7 +239,7 @@ namespace Konversation
}
/**For a given contact, adds the ircnick if they don't already have it. If you pass an addressBook, the contact is inserted
* if it has changed . */
void AddressbookBase : : associateNick ( K ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
void AddressbookBase : : associateNick ( TDE ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
{
//It's easiest to just remove it from the list if it's there already
unassociateNick ( addressee , ircnick , servername , servergroup ) ;
@ -259,9 +259,9 @@ namespace Konversation
addressBook - > insertAddressee ( addressee ) ;
}
/** This function associates the nick for a person, then iterates over all the contacts unassociating the nick from everyone else. It saves the addressses that have changed.*/
bool AddressbookBase : : associateNickAndUnassociateFromEveryoneElse ( K ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
bool AddressbookBase : : associateNickAndUnassociateFromEveryoneElse ( TDE ABC: : Addressee & addressee , const TQString & ircnick , const TQString & servername , const TQString & servergroup )
{
for ( K ABC: : AddressBook : : Iterator it = addressBook - > begin ( ) ; it ! = addressBook - > end ( ) ; + + it )
for ( TDE ABC: : AddressBook : : Iterator it = addressBook - > begin ( ) ; it ! = addressBook - > end ( ) ; + + it )
if ( ( * it ) . uid ( ) ! = addressee . uid ( ) )
unassociateNick ( * it , ircnick , servername , servergroup ) ;
associateNick ( addressee , ircnick , servername , servergroup ) ;
@ -335,7 +335,7 @@ namespace Konversation
return true ;
}
bool AddressbookBase : : saveAddressee ( K ABC: : Addressee & addressee )
bool AddressbookBase : : saveAddressee ( TDE ABC: : Addressee & addressee )
{
Q_ASSERT ( & addressee ) ;
addressBook - > insertAddressee ( addressee ) ;
@ -354,7 +354,7 @@ namespace Konversation
* @ param addressee Addressbook contact you want to know of the presence of
* @ return 0 ( unknown ) , 1 ( offline ) , 3 ( away ) , 4 ( online )
*/
int AddressbookBase : : presenceStatusByAddressee ( const K ABC: : Addressee & addressee )
int AddressbookBase : : presenceStatusByAddressee ( const TDE ABC: : Addressee & addressee )
{
Q_ASSERT ( & addressee ) ;
NickInfoPtr nickInfo = getNickInfo ( addressee ) ;
@ -370,7 +370,7 @@ namespace Konversation
return 4 ;
}
bool AddressbookBase : : isOnline ( K ABC: : Addressee & addressee )
bool AddressbookBase : : isOnline ( TDE ABC: : Addressee & addressee )
{
return ! ! getNickInfo ( addressee ) ;
}
@ -396,7 +396,7 @@ namespace Konversation
return true ;
}
bool AddressbookBase : : sendEmail ( const K ABC: : Addressee & addressee )
bool AddressbookBase : : sendEmail ( const TDE ABC: : Addressee & addressee )
{
if ( addressee . preferredEmail ( ) . isEmpty ( ) )
{
@ -430,7 +430,7 @@ namespace Konversation
{
NickInfoPtr nickInfo = ( * it ) - > getNickInfo ( ) ;
Q_ASSERT ( nickInfo ) ; if ( ! nickInfo ) return false ;
K ABC: : Addressee addr = nickInfo - > getAddressee ( ) ;
TDE ABC: : Addressee addr = nickInfo - > getAddressee ( ) ;
if ( addr . isEmpty ( ) )
{
nicksWithoutAddressee . append ( nickInfo - > getNickname ( ) ) ;