summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-12-10 01:24:17 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-12-10 18:54:30 +0100
commitdd43402365ac82e6f28d373ea857a38f473e9f45 (patch)
tree8a4825ac0df9d8f1f3f3685a9e0fd5f96d5e274d /kopete/libkopete
parent3ca6259d5b5b41ecce9759373714bdc57ff563d8 (diff)
downloadtdenetwork-dd43402365ac82e6f28d373ea857a38f473e9f45.tar.gz
tdenetwork-dd43402365ac82e6f28d373ea857a38f473e9f45.zip
kopete: Restore the AIM protocol because a replacement AIM server was created.
This reverts commits 036b0229db and dc34f9c391. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 91ba38a1df42b56caa73babc90ffa4f674c000d4)
Diffstat (limited to 'kopete/libkopete')
-rw-r--r--kopete/libkopete/kopetecontactlist.cpp23
-rw-r--r--kopete/libkopete/kopetecontactlistelement.cpp4
2 files changed, 22 insertions, 5 deletions
diff --git a/kopete/libkopete/kopetecontactlist.cpp b/kopete/libkopete/kopetecontactlist.cpp
index f4702885..dc8cdeb1 100644
--- a/kopete/libkopete/kopetecontactlist.cpp
+++ b/kopete/libkopete/kopetecontactlist.cpp
@@ -516,8 +516,8 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers
if( !oldContactElement.isNull() && oldContactElement.tagName() == TQString::fromLatin1("address-book-field") )
{
// Convert address book fields.
- // Jabber will be called "xmpp".
- // IRC, Oscar and SMS don't use address
+ // Jabber will be called "xmpp", Aim/Toc and Aim/Oscar both will
+ // be called "aim". AIM, IRC, Oscar and SMS don't use address
// book fields yet; Gadu and ICQ can be converted as-is.
// As Yahoo is unfinished we won't try to convert at all.
TQString id = oldContactElement.attribute( TQString::fromLatin1( "id" ), TQString() );
@@ -604,6 +604,7 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers
TQString id = oldContactElement.attribute( TQString::fromLatin1( "plugin-id" ), TQString() );
TQString data = oldContactElement.text();
+ bool convertOldAim = false;
uint fieldCount = 1;
TQString addressBookLabel;
if( id == TQString::fromLatin1("IRCProtocol") )
@@ -611,6 +612,17 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers
fieldCount = 3;
addressBookLabel = TQString::fromLatin1("irc");
}
+ else if( id == TQString::fromLatin1("OscarProtocol") )
+ {
+ fieldCount = 2;
+ addressBookLabel = TQString::fromLatin1("aim");
+ }
+ else if( id == TQString::fromLatin1("AIMProtocol") )
+ {
+ id = TQString::fromLatin1("OscarProtocol");
+ convertOldAim = true;
+ addressBookLabel = TQString::fromLatin1("aim");
+ }
else if( id == TQString::fromLatin1("ICQProtocol") || id == TQString::fromLatin1("WPProtocol") || id == TQString::fromLatin1("GaduProtocol") )
{
fieldCount = 1;
@@ -635,7 +647,8 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers
}
// Do the actual conversion
- if ( id == TQString::fromLatin1( "IRCProtocol" ) ||
+ if ( id == TQString::fromLatin1( "OscarProtocol" ) ||
+ id == TQString::fromLatin1( "AIMProtocol" ) || id == TQString::fromLatin1( "IRCProtocol" ) ||
id == TQString::fromLatin1( "ICQProtocol" ) || id == TQString::fromLatin1( "JabberProtocol" ) ||
id == TQString::fromLatin1( "SMSProtocol" ) || id == TQString::fromLatin1( "WPProtocol" ) ||
id == TQString::fromLatin1( "GaduProtocol" ) )
@@ -669,7 +682,7 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers
dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) );
pluginData[ id ].appendChild( dataField );
dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "displayName" ) );
- if( id == TQString::fromLatin1("ICQProtocol") || id == TQString::fromLatin1("WPProtocol") || id == TQString::fromLatin1("GaduProtocol") )
+ if( convertOldAim || id == TQString::fromLatin1("ICQProtocol") || id == TQString::fromLatin1("WPProtocol") || id == TQString::fromLatin1("GaduProtocol") )
dataField.appendChild( newList.createTextNode( strList[ idx ] ) );
else if( id == TQString::fromLatin1("JabberProtocol") )
dataField.appendChild( newList.createTextNode( strList[ idx + 2 ] ) );
@@ -712,7 +725,7 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers
idx += 2;
}
- // IRC, Oscar and SMS didn't store address book fields up
+ // AIM, IRC, Oscar and SMS didn't store address book fields up
// to now, so create one
if( id != TQString::fromLatin1("ICQProtocol") && id != TQString::fromLatin1("JabberProtocol") && id != TQString::fromLatin1("WPProtocol") && id != TQString::fromLatin1("GaduProtocol") )
{
diff --git a/kopete/libkopete/kopetecontactlistelement.cpp b/kopete/libkopete/kopetecontactlistelement.cpp
index 842228f6..cfce58b6 100644
--- a/kopete/libkopete/kopetecontactlistelement.cpp
+++ b/kopete/libkopete/kopetecontactlistelement.cpp
@@ -164,6 +164,10 @@ bool ContactListElement::fromXML( const TQDomElement& element )
TQMap<TQString, TQString> pluginData;
TQString pluginId = element.attribute( TQString::fromLatin1( "plugin-id" ), TQString() );
+ //in kopete 0.6 the AIM protocol was called OSCAR
+ if ( pluginId == TQString::fromLatin1( "OscarProtocol" ) )
+ pluginId = TQString::fromLatin1( "AIMProtocol" );
+
TQDomNode field = element.firstChild();
while( !field.isNull() )
{