From dc34f9c39105b0fe20ba45c064a08406084acbe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 30 Dec 2017 15:57:14 +0100 Subject: kopete: Remove AIM protocol AIM network has been shutdown in 2017-12-15 This resolves Bug 2846 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kopete/TODO | 7 +- kopete/kopete/kimiface.h | 8 +- .../kopete-account-tdeconf_update.cpp | 7 +- .../kopete/tdeconf_update/kopete-pluginloader.pl | 1 - kopete/libkopete/kopetecontactlist.cpp | 23 +- kopete/libkopete/kopetecontactlistelement.cpp | 4 - kopete/plugins/history/converter.cpp | 20 +- kopete/plugins/webpresence/webpresence_html.xsl | 3 - .../webpresence/webpresence_html_images.xsl | 3 - kopete/plugins/webpresence/webpresence_xhtml.xsl | 3 - .../webpresence/webpresence_xhtml_images.xsl | 3 - kopete/plugins/webpresence/webpresenceprefs.ui | 1 - kopete/protocols/jabber/jabbertransport.cpp | 6 +- kopete/protocols/oscar/CMakeLists.txt | 1 - kopete/protocols/oscar/Makefile.am | 2 +- kopete/protocols/oscar/TODO | 2 - kopete/protocols/oscar/aim/CMakeLists.txt | 47 -- kopete/protocols/oscar/aim/Makefile.am | 18 - kopete/protocols/oscar/aim/aim.protocol | 13 - kopete/protocols/oscar/aim/aimaccount.cpp | 924 --------------------- kopete/protocols/oscar/aim/aimaccount.h | 148 ---- kopete/protocols/oscar/aim/aimchatsession.cpp | 73 -- kopete/protocols/oscar/aim/aimchatsession.h | 78 -- kopete/protocols/oscar/aim/aimcontact.cpp | 520 ------------ kopete/protocols/oscar/aim/aimcontact.h | 103 --- kopete/protocols/oscar/aim/aimjoinchat.cpp | 94 --- kopete/protocols/oscar/aim/aimjoinchat.h | 63 -- kopete/protocols/oscar/aim/aimprotocol.cpp | 320 ------- kopete/protocols/oscar/aim/aimprotocol.h | 86 -- kopete/protocols/oscar/aim/aimuserinfo.cpp | 224 ----- kopete/protocols/oscar/aim/aimuserinfo.h | 60 -- kopete/protocols/oscar/aim/kopete_aim.desktop | 77 -- kopete/protocols/oscar/aim/ui/CMakeLists.txt | 31 - kopete/protocols/oscar/aim/ui/Makefile.am | 15 - .../protocols/oscar/aim/ui/aimaddcontactpage.cpp | 83 -- kopete/protocols/oscar/aim/ui/aimaddcontactpage.h | 42 - kopete/protocols/oscar/aim/ui/aimaddcontactui.ui | 64 -- kopete/protocols/oscar/aim/ui/aimeditaccountui.ui | 540 ------------ .../oscar/aim/ui/aimeditaccountwidget.cpp | 172 ---- .../protocols/oscar/aim/ui/aimeditaccountwidget.h | 59 -- kopete/protocols/oscar/aim/ui/aiminfobase.ui | 246 ------ kopete/protocols/oscar/aim/ui/aimjoinchatbase.ui | 124 --- .../oscar/icons/cr128-app-aim_protocol.png | Bin 4342 -> 0 bytes .../protocols/oscar/icons/cr16-action-aim_away.png | Bin 306 -> 0 bytes .../oscar/icons/cr16-action-aim_connecting.mng | Bin 3121 -> 0 bytes .../oscar/icons/cr16-action-aim_offline.png | Bin 578 -> 0 bytes .../oscar/icons/cr16-action-aim_online.png | Bin 627 -> 0 bytes .../oscar/icons/cr16-app-aim_protocol.png | Bin 599 -> 0 bytes .../oscar/icons/cr32-app-aim_protocol.png | Bin 1475 -> 0 bytes .../oscar/icons/cr48-app-aim_protocol.png | Bin 2387 -> 0 bytes .../oscar/icons/cr64-app-aim_protocol.png | Bin 3383 -> 0 bytes .../protocols/oscar/icons/hi16-action-aim_away.png | Bin 282 -> 0 bytes .../oscar/icons/hi16-action-aim_connecting.mng | Bin 2998 -> 0 bytes .../oscar/icons/hi16-action-aim_offline.png | Bin 353 -> 0 bytes .../oscar/icons/hi16-action-aim_online.png | Bin 416 -> 0 bytes .../oscar/icons/hi16-app-aim_protocol.png | Bin 416 -> 0 bytes .../oscar/icons/hi32-app-aim_protocol.png | Bin 519 -> 0 bytes kopete/protocols/oscar/icq/kopete_icq.desktop | 2 +- kopete/protocols/yahoo/libkyahoo/yabentry.cpp | 3 - kopete/protocols/yahoo/libkyahoo/yabentry.h | 1 - kopete/protocols/yahoo/ui/yahoouserinfodialog.cpp | 2 - kopete/protocols/yahoo/yahoocontact.cpp | 2 - kopete/protocols/yahoo/yahooprotocol.cpp | 1 - kopete/protocols/yahoo/yahooprotocol.h | 1 - 64 files changed, 18 insertions(+), 4312 deletions(-) delete mode 100644 kopete/protocols/oscar/aim/CMakeLists.txt delete mode 100644 kopete/protocols/oscar/aim/Makefile.am delete mode 100644 kopete/protocols/oscar/aim/aim.protocol delete mode 100644 kopete/protocols/oscar/aim/aimaccount.cpp delete mode 100644 kopete/protocols/oscar/aim/aimaccount.h delete mode 100644 kopete/protocols/oscar/aim/aimchatsession.cpp delete mode 100644 kopete/protocols/oscar/aim/aimchatsession.h delete mode 100644 kopete/protocols/oscar/aim/aimcontact.cpp delete mode 100644 kopete/protocols/oscar/aim/aimcontact.h delete mode 100644 kopete/protocols/oscar/aim/aimjoinchat.cpp delete mode 100644 kopete/protocols/oscar/aim/aimjoinchat.h delete mode 100644 kopete/protocols/oscar/aim/aimprotocol.cpp delete mode 100644 kopete/protocols/oscar/aim/aimprotocol.h delete mode 100644 kopete/protocols/oscar/aim/aimuserinfo.cpp delete mode 100644 kopete/protocols/oscar/aim/aimuserinfo.h delete mode 100644 kopete/protocols/oscar/aim/kopete_aim.desktop delete mode 100644 kopete/protocols/oscar/aim/ui/CMakeLists.txt delete mode 100644 kopete/protocols/oscar/aim/ui/Makefile.am delete mode 100644 kopete/protocols/oscar/aim/ui/aimaddcontactpage.cpp delete mode 100644 kopete/protocols/oscar/aim/ui/aimaddcontactpage.h delete mode 100644 kopete/protocols/oscar/aim/ui/aimaddcontactui.ui delete mode 100644 kopete/protocols/oscar/aim/ui/aimeditaccountui.ui delete mode 100644 kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp delete mode 100644 kopete/protocols/oscar/aim/ui/aimeditaccountwidget.h delete mode 100644 kopete/protocols/oscar/aim/ui/aiminfobase.ui delete mode 100644 kopete/protocols/oscar/aim/ui/aimjoinchatbase.ui delete mode 100644 kopete/protocols/oscar/icons/cr128-app-aim_protocol.png delete mode 100644 kopete/protocols/oscar/icons/cr16-action-aim_away.png delete mode 100644 kopete/protocols/oscar/icons/cr16-action-aim_connecting.mng delete mode 100644 kopete/protocols/oscar/icons/cr16-action-aim_offline.png delete mode 100644 kopete/protocols/oscar/icons/cr16-action-aim_online.png delete mode 100644 kopete/protocols/oscar/icons/cr16-app-aim_protocol.png delete mode 100644 kopete/protocols/oscar/icons/cr32-app-aim_protocol.png delete mode 100644 kopete/protocols/oscar/icons/cr48-app-aim_protocol.png delete mode 100644 kopete/protocols/oscar/icons/cr64-app-aim_protocol.png delete mode 100644 kopete/protocols/oscar/icons/hi16-action-aim_away.png delete mode 100644 kopete/protocols/oscar/icons/hi16-action-aim_connecting.mng delete mode 100644 kopete/protocols/oscar/icons/hi16-action-aim_offline.png delete mode 100644 kopete/protocols/oscar/icons/hi16-action-aim_online.png delete mode 100644 kopete/protocols/oscar/icons/hi16-app-aim_protocol.png delete mode 100644 kopete/protocols/oscar/icons/hi32-app-aim_protocol.png (limited to 'kopete') diff --git a/kopete/TODO b/kopete/TODO index eab40274..5c22ed26 100644 --- a/kopete/TODO +++ b/kopete/TODO @@ -32,7 +32,7 @@ Beware: It's totally unsorted ;) ================================================================================ -OSCAR ICQ/AIM TODO ITEMS +OSCAR ICQ TODO ITEMS OSCAR in general======================================================== - somehow sync server and local list, this is not as trivial as everybody @@ -48,7 +48,6 @@ OSCAR ICQ/AIM TODO ITEMS (should work if kopete groupname == serverside groupname) X Base Buffer class on something like QDataStream (if possible), I don't like all the pointer stuff in here - X get rid of AIMContactList, AIMBuddy (almost gone already) and AIMGroup. ICQ specific =========================================================== X support simple icq type-2 messages so we can send/receive away @@ -70,9 +69,5 @@ OSCAR ICQ/AIM TODO ITEMS - support sending all of your own icq userinfo to the server, it's easy to do but a lot of of boring work - AIM specific =========================================================== - - Nothing in here yet, I'd appreciate somebody with more extensive use - of AIM to take over just that part of the plugin. - ================================================================================ diff --git a/kopete/kopete/kimiface.h b/kopete/kopete/kimiface.h index 970d9698..8d00c0b0 100644 --- a/kopete/kopete/kimiface.h +++ b/kopete/kopete/kimiface.h @@ -106,8 +106,8 @@ k_dcop: /** * Get the KABC uid corresponding to the supplied IM address * Protocols should be - * @param contactId the protocol specific identifier for the contact, eg UIN for ICQ, screenname for AIM, nick for IRC. - * @param protocol the protocol, eg one of "AIMProtocol", "ICQProtocol", + * @param contactId the protocol specific identifier for the contact, eg UIN for ICQ, nick for IRC. + * @param protocol the protocol, eg one of "ICQProtocol", * @return a KABC uid or null if none found/ */ virtual TQString locate( const TQString & contactId, const TQString & protocol ) = 0; @@ -166,8 +166,8 @@ k_dcop: // Contact list /** * Add a contact to the contact list - * @param contactId the protocol specific identifier for the contact, eg UIN for ICQ, screenname for AIM, nick for IRC. - * @param protocol the protocol, eg one of "AIMProtocol", "ICQProtocol", ... + * @param contactId the protocol specific identifier for the contact, eg UIN for ICQ, nick for IRC. + * @param protocol the protocol, eg one of "ICQProtocol",... * @return whether the add succeeded. False may signal already present, protocol not supported, or add operation not supported. */ virtual bool addContact( const TQString &contactId, const TQString &protocol ) = 0; diff --git a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp index 67b39ad8..d1de27f2 100644 --- a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp +++ b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp @@ -55,15 +55,12 @@ void parseGroup( const TQString &group, const TQString &rawLine ) { // Groups that are converted can almost certainly be removed entirely - if ( group == "ICQ" || group == "Oscar" || group == "Gadu" || group == "Jabber" || group == "IRC" ) + if ( group == "ICQ" || group == "Gadu" || group == "Jabber" || group == "IRC" ) { accountId = "EMPTY"; autoConnect = "true"; - if ( group == "Oscar" ) - protocol = "AIMProtocol"; - else - protocol = group + "Protocol"; + protocol = group + "Protocol"; password = TQString(); pluginData.clear(); diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader.pl b/kopete/kopete/tdeconf_update/kopete-pluginloader.pl index 19709d3a..94d1d4f9 100755 --- a/kopete/kopete/tdeconf_update/kopete-pluginloader.pl +++ b/kopete/kopete/tdeconf_update/kopete-pluginloader.pl @@ -16,7 +16,6 @@ while( my $line = <> ) $moduleLine =~ s/^Modules/Plugins/; $moduleLine =~ s/\.plugin/\.desktop/g; -$moduleLine =~ s/oscar/aim/; if ( $logging == "true" ) { chomp $moduleLine; diff --git a/kopete/libkopete/kopetecontactlist.cpp b/kopete/libkopete/kopetecontactlist.cpp index dc8cdeb1..f4702885 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", Aim/Toc and Aim/Oscar both will - // be called "aim". AIM, IRC, Oscar and SMS don't use address + // Jabber will be called "xmpp". + // 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,7 +604,6 @@ 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") ) @@ -612,17 +611,6 @@ 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; @@ -647,8 +635,7 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers } // Do the actual conversion - if ( id == TQString::fromLatin1( "OscarProtocol" ) || - id == TQString::fromLatin1( "AIMProtocol" ) || id == TQString::fromLatin1( "IRCProtocol" ) || + if ( id == TQString::fromLatin1( "IRCProtocol" ) || id == TQString::fromLatin1( "ICQProtocol" ) || id == TQString::fromLatin1( "JabberProtocol" ) || id == TQString::fromLatin1( "SMSProtocol" ) || id == TQString::fromLatin1( "WPProtocol" ) || id == TQString::fromLatin1( "GaduProtocol" ) ) @@ -682,7 +669,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( convertOldAim || id == TQString::fromLatin1("ICQProtocol") || id == TQString::fromLatin1("WPProtocol") || id == TQString::fromLatin1("GaduProtocol") ) + if( 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 ] ) ); @@ -725,7 +712,7 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers idx += 2; } - // AIM, IRC, Oscar and SMS didn't store address book fields up + // 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 cfce58b6..842228f6 100644 --- a/kopete/libkopete/kopetecontactlistelement.cpp +++ b/kopete/libkopete/kopetecontactlistelement.cpp @@ -164,10 +164,6 @@ bool ContactListElement::fromXML( const TQDomElement& element ) TQMap 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() ) { diff --git a/kopete/plugins/history/converter.cpp b/kopete/plugins/history/converter.cpp index 4285309c..44b41fe9 100644 --- a/kopete/plugins/history/converter.cpp +++ b/kopete/plugins/history/converter.cpp @@ -68,24 +68,12 @@ void HistoryPlugin::convertOldHistory() if(accountId.isNull() || protocolId.isNull()) { - if(fi->fileName() == "ICQProtocol" || fi->fileName() == "icq_logs" ) + if(fi->fileName() == "ICQProtocol" || fi->fileName() == "icq_logs" ) { protocolId="ICQProtocol"; TDEGlobal::config()->setGroup("ICQ"); accountId=TDEGlobal::config()->readEntry( "UIN" ); } - else if(fi->fileName() == "AIMProtocol" || fi->fileName() == "aim_logs" ) - { - protocolId="AIMProtocol"; - TDEGlobal::config()->setGroup("AIM"); - accountId=TDEGlobal::config()->readEntry( "UserID" ); - } - else if(fi->fileName() == "OscarProtocol" ) - { - protocolId="AIMProtocol"; - TDEGlobal::config()->setGroup("OSCAR"); - accountId=TDEGlobal::config()->readEntry( "UserID" ); - } else if(fi->fileName() == "JabberProtocol" || fi->fileName() == "jabber_logs") { protocolId="JabberProtocol"; @@ -319,11 +307,7 @@ bool HistoryPlugin::detectOldHistory() if( dynamic_cast( Kopete::PluginManager::self()->plugin( fi->fileName() ) ) ) return true; - if(fi->fileName() == "ICQProtocol" || fi->fileName() == "icq_logs" ) - return true; - else if(fi->fileName() == "AIMProtocol" || fi->fileName() == "aim_logs" ) - return true; - else if(fi->fileName() == "OscarProtocol" ) + if(fi->fileName() == "ICQProtocol" || fi->fileName() == "icq_logs" ) return true; else if(fi->fileName() == "JabberProtocol" || fi->fileName() == "jabber_logs") return true; diff --git a/kopete/plugins/webpresence/webpresence_html.xsl b/kopete/plugins/webpresence/webpresence_html.xsl index e0e55589..e1e8f7cb 100644 --- a/kopete/plugins/webpresence/webpresence_html.xsl +++ b/kopete/plugins/webpresence/webpresence_html.xsl @@ -54,9 +54,6 @@ - - AIM - ICQ diff --git a/kopete/plugins/webpresence/webpresence_html_images.xsl b/kopete/plugins/webpresence/webpresence_html_images.xsl index bd97657b..ace0c75b 100644 --- a/kopete/plugins/webpresence/webpresence_html_images.xsl +++ b/kopete/plugins/webpresence/webpresence_html_images.xsl @@ -33,9 +33,6 @@ Yahoo - - AIM - IRC diff --git a/kopete/plugins/webpresence/webpresence_xhtml.xsl b/kopete/plugins/webpresence/webpresence_xhtml.xsl index acec55ee..b50924ab 100644 --- a/kopete/plugins/webpresence/webpresence_xhtml.xsl +++ b/kopete/plugins/webpresence/webpresence_xhtml.xsl @@ -53,9 +53,6 @@ - - AIM - ICQ diff --git a/kopete/plugins/webpresence/webpresence_xhtml_images.xsl b/kopete/plugins/webpresence/webpresence_xhtml_images.xsl index cf8d0219..9c136171 100644 --- a/kopete/plugins/webpresence/webpresence_xhtml_images.xsl +++ b/kopete/plugins/webpresence/webpresence_xhtml_images.xsl @@ -34,9 +34,6 @@ Yahoo - - AIM - IRC diff --git a/kopete/plugins/webpresence/webpresenceprefs.ui b/kopete/plugins/webpresence/webpresenceprefs.ui index 89670521..cb78bd36 100644 --- a/kopete/plugins/webpresence/webpresenceprefs.ui +++ b/kopete/plugins/webpresence/webpresenceprefs.ui @@ -212,7 +212,6 @@ The following files are used by default: images/icq_protocol.png images/jabber_protocol.png images/yahoo_protocol.png -images/aim_protocol.png images/irc_protocol.png images/sms_protocol.png images/gadu_protocol.png diff --git a/kopete/protocols/jabber/jabbertransport.cpp b/kopete/protocols/jabber/jabbertransport.cpp index 5cf5ffa5..c984b2aa 100644 --- a/kopete/protocols/jabber/jabbertransport.cpp +++ b/kopete/protocols/jabber/jabbertransport.cpp @@ -54,10 +54,8 @@ JabberTransport::JabberTransport (JabberAccount * parentAccount, const XMPP::Ros #if KOPETE_IS_VERSION(0,11,51) //setCustomIcon is new in kopete 0.12 TQString cIcon; - if(gateway_type=="icq") + if(gateway_type=="icq") cIcon="jabber_gateway_icq"; - else if(gateway_type=="aim") - cIcon="jabber_gateway_aim"; else if(gateway_type=="yahoo") cIcon="jabber_gateway_yahoo"; else if(gateway_type=="sms") @@ -77,7 +75,7 @@ JabberTransport::JabberTransport (JabberAccount * parentAccount, const XMPP::Ros if( !cIcon.isEmpty() ) setCustomIcon( cIcon ); -#endif +#endif configGroup()->writeEntry("GatewayJID" , item.jid().full() ); diff --git a/kopete/protocols/oscar/CMakeLists.txt b/kopete/protocols/oscar/CMakeLists.txt index bbffa100..9491dadf 100644 --- a/kopete/protocols/oscar/CMakeLists.txt +++ b/kopete/protocols/oscar/CMakeLists.txt @@ -10,7 +10,6 @@ ################################################# add_subdirectory( liboscar ) -add_subdirectory( aim ) add_subdirectory( icq ) add_subdirectory( icons ) diff --git a/kopete/protocols/oscar/Makefile.am b/kopete/protocols/oscar/Makefile.am index 93f1f859..3fce9e09 100644 --- a/kopete/protocols/oscar/Makefile.am +++ b/kopete/protocols/oscar/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = liboscar . aim icq icons +SUBDIRS = liboscar . icq icons METASOURCES = AUTO AM_CPPFLAGS = -I./ui -I$(srcdir)/ui \ -I./liboscar -I$(srcdir)/liboscar \ diff --git a/kopete/protocols/oscar/TODO b/kopete/protocols/oscar/TODO index 25c82ee8..3e20780e 100644 --- a/kopete/protocols/oscar/TODO +++ b/kopete/protocols/oscar/TODO @@ -2,7 +2,6 @@ This is the TODO file for the OSCAR plugin. ====== Possible refactorings ===== -- Unify status handling for ICQ and AIM? I like the ICQ::Presence thing, that's cool - Do delayed contact creation like on MSN so that when we actually get a good status code back from the SSI manipulation, we create the contact then rather than hoping it all works out. @@ -47,7 +46,6 @@ that was done in oscarsocket, that will need redoing in liboscar for the same account, one at home and one at work). - make renaming serverside contacts possible (function is there but fails due to massive contactlist bugs caused by above mentioned classes) -- support logging in with something different than "online" status for AIM - finish icq userinfo dialog and sending your own icq userinfo to the server, it's easy to do but because of the mass of items takes lots of time and is extremely boring. (requires snac 0x15, * parsing) diff --git a/kopete/protocols/oscar/aim/CMakeLists.txt b/kopete/protocols/oscar/aim/CMakeLists.txt deleted file mode 100644 index 75230df3..00000000 --- a/kopete/protocols/oscar/aim/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( ui ) - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/ui - ${CMAKE_CURRENT_SOURCE_DIR}/ui - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/../liboscar - ${CMAKE_SOURCE_DIR}/kopete/libkopete - ${CMAKE_SOURCE_DIR}/kopete/libkopete/ui - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -install( FILES - kopete_aim.desktop aim.protocol - DESTINATION ${SERVICES_INSTALL_DIR} ) - - -##### kopete_aim (module) ####################### - -tde_add_kpart( kopete_aim AUTOMOC - SOURCES - aimprotocol.cpp aimaccount.cpp aimcontact.cpp aimuserinfo.cpp - aimjoinchat.cpp aimchatsession.cpp - LINK - kopeteaimui-static kopete_oscar-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kopete/protocols/oscar/aim/Makefile.am b/kopete/protocols/oscar/aim/Makefile.am deleted file mode 100644 index 5d1cc8b6..00000000 --- a/kopete/protocols/oscar/aim/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -SUBDIRS = ui -METASOURCES = AUTO -AM_CPPFLAGS = -I$(srcdir)/../ \ - -I$(srcdir)/ui/ \ - -I$(top_builddir)/kopete/protocols/oscar/aim/ui \ - -I$(srcdir)/../liboscar \ - $(KOPETE_INCLUDES) $(all_includes) - -kde_module_LTLIBRARIES = kopete_aim.la - -kopete_aim_la_SOURCES = aimprotocol.cpp aimaccount.cpp aimcontact.cpp aimuserinfo.cpp aimjoinchat.cpp aimchatsession.cpp - -kopete_aim_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kopete_aim_la_LIBADD = ../libkopete_oscar.la ui/libkopeteaimui.la \ - $(top_builddir)/kopete/libkopete/libkopete.la - -service_DATA = kopete_aim.desktop aim.protocol -servicedir = $(kde_servicesdir) diff --git a/kopete/protocols/oscar/aim/aim.protocol b/kopete/protocols/oscar/aim/aim.protocol deleted file mode 100644 index 0af5be59..00000000 --- a/kopete/protocols/oscar/aim/aim.protocol +++ /dev/null @@ -1,13 +0,0 @@ -[Protocol] -exec=kopete "%u" -protocol=aim -input=none -output=none -helper=true -listing=false -reading=false -writing=false -makedir=false -deleting=false -URIMode=rawuri -Icon=aim_protocol diff --git a/kopete/protocols/oscar/aim/aimaccount.cpp b/kopete/protocols/oscar/aim/aimaccount.cpp deleted file mode 100644 index f6be26b7..00000000 --- a/kopete/protocols/oscar/aim/aimaccount.cpp +++ /dev/null @@ -1,924 +0,0 @@ -/* - aimaccount.cpp - Oscar Protocol Plugin, AIM part - - Kopete (c) 2002-2003 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* -*/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "kopeteawayaction.h" -#include "kopetepassword.h" -#include "kopetestdaction.h" -#include "kopeteuiglobal.h" -#include "kopetecontactlist.h" -#include "kopetemetacontact.h" -#include "kopeteprotocol.h" -#include "kopetechatsessionmanager.h" -#include "kopeteview.h" -#include - -#include "aimprotocol.h" -#include "aimaccount.h" -#include "aimchatsession.h" -#include "aimcontact.h" -#include "aimuserinfo.h" -#include "aimjoinchat.h" -#include "oscarmyselfcontact.h" -#include "oscarvisibilitydialog.h" - -#include "oscarutils.h" -#include "client.h" -#include "ssimanager.h" - - -const DWORD AIM_ONLINE = 0x0; -const DWORD AIM_AWAY = 0x1; - -namespace Kopete { class MetaContact; } - -AIMMyselfContact::AIMMyselfContact( AIMAccount *acct ) -: OscarMyselfContact( acct ) -{ - m_acct = acct; -} - -void AIMMyselfContact::userInfoUpdated() -{ - if ( ( details().userClass() & 32 ) == 0 ) - setOnlineStatus( static_cast( protocol() )->statusOnline ); //we're online - else - setOnlineStatus( static_cast( protocol() )->statusAway ); //we're away -} - -void AIMMyselfContact::setOwnProfile( const TQString& newProfile ) -{ - m_profileString = newProfile; - if ( m_acct->isConnected() ) - m_acct->engine()->updateProfile( newProfile ); -} - -TQString AIMMyselfContact::userProfile() -{ - return m_profileString; -} - -Kopete::ChatSession* AIMMyselfContact::manager( Kopete::Contact::CanCreateFlags canCreate, - Oscar::WORD exchange, const TQString& room ) -{ - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << endl; - Kopete::ContactPtrList chatMembers; - chatMembers.append( this ); - Kopete::ChatSession* genericManager = 0L; - genericManager = Kopete::ChatSessionManager::self()->findChatSession( account()->myself(), chatMembers, protocol() ); - AIMChatSession* session = dynamic_cast( genericManager ); - - if ( !session && canCreate == Contact::CanCreate ) - { - session = new AIMChatSession( this, chatMembers, account()->protocol(), exchange, room ); - session->setEngine( m_acct->engine() ); - - connect( session, TQT_SIGNAL( messageSent( Kopete::Message&, Kopete::ChatSession* ) ), - this, TQT_SLOT( sendMessage( Kopete::Message&, Kopete::ChatSession* ) ) ); - m_chatRoomSessions.append( session ); - } - return session; -} - -void AIMMyselfContact::chatSessionDestroyed( Kopete::ChatSession* session ) -{ - m_chatRoomSessions.remove( session ); -} - -void AIMMyselfContact::sendMessage( Kopete::Message& message, Kopete::ChatSession* session ) -{ - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "sending a message" << endl; - //TODO: remove duplication - factor into a message utils class or something - Oscar::Message msg; - TQString s; - - if (message.plainBody().isEmpty()) // no text, do nothing - return; - //okay, now we need to change the message.escapedBody from real HTML to aimhtml. - //looking right now for docs on that "format". - //looks like everything except for alignment codes comes in the format of spans - - //font-style:italic -> - //font-weight:600 -> (anything > 400 should be , 400 is not bold) - //text-decoration:underline -> - //font-family: -> - //font-size:xxpt -> - - s=message.escapedBody(); - s.replace ( TQRegExp( TQString::fromLatin1("([^<]*)")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("\\2")); - - //okay now change the to - - //0-9 are size 1 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //10-11 are size 2 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //12-13 are size 3 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //14-16 are size 4 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //17-22 are size 5 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //23-29 are size 6 - s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); - //30- (and any I missed) are size 7 - s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); - - s.replace ( TQRegExp ( TQString::fromLatin1("")), TQString::fromLatin1("
") ); - - kdDebug(14190) << k_funcinfo << "sending " - << s << endl; - - msg.setSender( contactId() ); - msg.setText( Oscar::Message::UserDefined, s, m_acct->defaultCodec() ); - msg.setTimestamp(message.timestamp()); - msg.setType(0x03); - msg.addProperty( Oscar::Message::ChatRoom ); - - AIMChatSession* aimSession = dynamic_cast( session ); - if ( !aimSession ) - { - kdWarning(OSCAR_AIM_DEBUG) << "couldn't convert to AIM chat room session!" << endl; - session->messageSucceeded(); - return; - } - msg.setExchange( aimSession->exchange() ); - msg.setChatRoom( aimSession->roomName() ); - - m_acct->engine()->sendMessage( msg ); - //session->appendMessage( message ); - session->messageSucceeded(); -} - - -AIMAccount::AIMAccount(Kopete::Protocol *parent, TQString accountID, const char *name) - : OscarAccount(parent, accountID, name, false) -{ - kdDebug(14152) << k_funcinfo << accountID << ": Called."<< endl; - AIMMyselfContact* mc = new AIMMyselfContact( this ); - setMyself( mc ); - myself()->setOnlineStatus( static_cast( parent )->statusOffline ); - TQString profile = configGroup()->readEntry( "Profile", - i18n( "Visit the Kopete website at http://kopete.kde.org") ); - mc->setOwnProfile( profile ); - - m_joinChatDialog = 0; - m_visibilityDialog = 0; - TQObject::connect( Kopete::ContactList::self(), - TQT_SIGNAL( globalIdentityChanged( const TQString&, const TQVariant& ) ), - this, - TQT_SLOT( slotGlobalIdentityChanged( const TQString&, const TQVariant& ) ) ); - - TQObject::connect( engine(), TQT_SIGNAL( chatRoomConnected( WORD, const TQString& ) ), - this, TQT_SLOT( connectedToChatRoom( WORD, const TQString& ) ) ); - - TQObject::connect( engine(), TQT_SIGNAL( userJoinedChat( Oscar::WORD, const TQString&, const TQString& ) ), - this, TQT_SLOT( userJoinedChat( Oscar::WORD, const TQString&, const TQString& ) ) ); - - TQObject::connect( engine(), TQT_SIGNAL( userLeftChat( Oscar::WORD, const TQString&, const TQString& ) ), - this, TQT_SLOT( userLeftChat( Oscar::WORD, const TQString&, const TQString& ) ) ); - - TQObject::connect( this, TQT_SIGNAL( buddyIconChanged() ), this, TQT_SLOT( slotBuddyIconChanged() ) ); - -} - -AIMAccount::~AIMAccount() -{ -} - -OscarContact *AIMAccount::createNewContact( const TQString &contactId, Kopete::MetaContact *parentContact, const SSI& ssiItem ) -{ - AIMContact* contact = new AIMContact( this, contactId, parentContact, TQString(), ssiItem ); - if ( !ssiItem.alias().isEmpty() ) - contact->setProperty( Kopete::Global::Properties::self()->nickName(), ssiItem.alias() ); - - return contact; -} - -TQString AIMAccount::sanitizedMessage( const TQString& message ) -{ - TQDomDocument doc; - TQString domError; - int errLine = 0, errCol = 0; - doc.setContent( message, false, &domError, &errLine, &errCol ); - if ( !domError.isEmpty() ) //error parsing, do nothing - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "error from dom document conversion: " - << domError << endl; - return message; - } - else - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "conversion to dom document successful." - << "looking for font tags" << endl; - TQDomNodeList fontTagList = doc.elementsByTagName( "font" ); - if ( fontTagList.count() == 0 ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "No font tags found. Returning normal message" << endl; - return message; - } - else - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Found font tags. Attempting replacement" << endl; - uint numFontTags = fontTagList.count(); - for ( uint i = 0; i < numFontTags; i++ ) - { - TQDomNode fontNode = fontTagList.item(i); - TQDomElement fontEl; - if ( !fontNode.isNull() && fontNode.isElement() ) - fontEl = fontTagList.item(i).toElement(); - else - continue; - if ( fontEl.hasAttribute( "back" ) ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Found attribute to replace. Doing replacement" << endl; - TQString backgroundColor = fontEl.attribute( "back" ); - backgroundColor.insert( 0, "background-color: " ); - backgroundColor.append( ';' ); - fontEl.setAttribute( "style", backgroundColor ); - fontEl.removeAttribute( "back" ); - } - } - } - } - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "sanitized message is " << doc.toString(); - return doc.toString(); -} - -TDEActionMenu* AIMAccount::actionMenu() -{ -// kdDebug(14152) << k_funcinfo << accountId() << ": Called." << endl; - // mActionMenu is managed by Kopete::Account. It is deleted when - // it is no longer shown, so we can (safely) just make a new one here. - TDEActionMenu *mActionMenu = new TDEActionMenu(accountId(), - myself()->onlineStatus().iconFor( this ), this, "AIMAccount::mActionMenu"); - - AIMProtocol *p = AIMProtocol::protocol(); - - TQString accountNick = myself()->property( Kopete::Global::Properties::self()->nickName() ).value().toString(); - mActionMenu->popupMenu()->insertTitle( myself()->onlineStatus().iconFor( myself() ), - i18n( "%2 <%1>" ).arg( accountId(), accountNick )); - - mActionMenu->insert( new TDEAction( i18n("Online"), p->statusOnline.iconFor( this ), 0, this, - TQT_SLOT( slotGoOnline() ), mActionMenu, "AIMAccount::mActionOnline") ); - - TDEAction* mActionAway = new Kopete::AwayAction(i18n("Away"), p->statusAway.iconFor( this ), 0, this, - TQT_SLOT(slotGoAway( const TQString & )), this, "AIMAccount::mActionNA" ); - mActionAway->setEnabled( isConnected() ); - mActionMenu->insert( mActionAway ); - - TDEAction* mActionOffline = new TDEAction( i18n("Offline"), p->statusOffline.iconFor(this), 0, this, - TQT_SLOT( slotGoOffline() ), mActionMenu, "AIMAccount::mActionOffline"); - - mActionMenu->insert( mActionOffline ); - mActionMenu->popupMenu()->insertSeparator(); - - TDEAction* m_joinChatAction = new TDEAction( i18n( "Join Chat..." ), TQString(), 0, this, - TQT_SLOT( slotJoinChat() ), mActionMenu, "join_a_chat" ); - - mActionMenu->insert( new TDEToggleAction( i18n( "Set Visibility..." ), 0, 0, - this, TQT_SLOT( slotSetVisiblility() ), this, - "AIMAccount::mActionSetVisibility") ); - - mActionMenu->insert( m_joinChatAction ); - - TDEAction* m_editInfoAction = new TDEAction( i18n( "Edit User Info..." ), "identity", 0, - this, TQT_SLOT( slotEditInfo() ), mActionMenu, "actionEditInfo"); - - mActionMenu->insert( m_editInfoAction ); - - return mActionMenu; -} - -void AIMAccount::setAway(bool away, const TQString &awayReason) -{ -// kdDebug(14152) << k_funcinfo << accountId() << "reason is " << awayReason << endl; - if ( away ) - { - engine()->setStatus( Client::Away, awayReason ); - AIMMyselfContact* me = static_cast ( myself() ); - me->setLastAwayMessage(awayReason); - me->setProperty( Kopete::Global::Properties::self()->awayMessage(), awayReason ); - } - else - { - engine()->setStatus( Client::Online ); - AIMMyselfContact* me = static_cast ( myself() ); - me->setLastAwayMessage(TQString()); - me->removeProperty( Kopete::Global::Properties::self()->awayMessage() ); - } -} - -void AIMAccount::setOnlineStatus( const Kopete::OnlineStatus& status, const TQString& reason ) -{ - kdDebug(14152) << k_funcinfo << "called with reason = " << reason <<" status = "<< status.status() << endl;; - if ( status.status() == Kopete::OnlineStatus::Online ) - setAway( false ); - if ( status.status() == Kopete::OnlineStatus::Away ) - setAway( true, reason ); -} - - -void AIMAccount::setUserProfile(const TQString &profile) -{ - kdDebug(14152) << k_funcinfo << "called." << endl; - AIMMyselfContact* aimmc = dynamic_cast( myself() ); - if ( aimmc ) - aimmc->setOwnProfile( profile ); - configGroup()->writeEntry( TQString::fromLatin1( "Profile" ), profile ); -} - -void AIMAccount::slotEditInfo() -{ - if ( !isConnected() ) - { - KMessageBox::sorry( Kopete::UI::Global::mainWidget(), - i18n( "Editing your user info is not possible because " - "you are not connected." ), - i18n( "Unable to edit user info" ) ); - return; - } - AIMUserInfoDialog *myInfo = new AIMUserInfoDialog(static_cast( myself() ), this, true, 0L, "myInfo"); - myInfo->exec(); // This is a modal dialog -} - -void AIMAccount::slotGlobalIdentityChanged( const TQString& key, const TQVariant& value ) -{ - //do something with the photo - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Global identity changed" << endl; - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "key: " << key << endl; - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "value: " << value << endl; - - if( !configGroup()->readBoolEntry("ExcludeGlobalIdentity", false) ) - { - if ( key == Kopete::Global::Properties::self()->nickName().key() ) - { - //edit ssi item to change alias (if possible) - } - - if ( key == Kopete::Global::Properties::self()->photo().key() ) - { - setBuddyIcon( value.toString() ); - } - } -} - -void AIMAccount::slotBuddyIconChanged() -{ - // need to disconnect because we could end up with many connections - TQObject::disconnect( engine(), TQT_SIGNAL( iconServerConnected() ), this, TQT_SLOT( slotBuddyIconChanged() ) ); - if ( !engine()->isActive() ) - { - TQObject::connect( engine(), TQT_SIGNAL( iconServerConnected() ), this, TQT_SLOT( slotBuddyIconChanged() ) ); - return; - } - - TQString photoPath = myself()->property( Kopete::Global::Properties::self()->photo() ).value().toString(); - - SSIManager* ssi = engine()->ssiManager(); - Oscar::SSI item = ssi->findItemForIconByRef( 1 ); - - if ( photoPath.isEmpty() ) - { - if ( item ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Removing icon hash item from ssi" << endl; - Oscar::SSI s(item); - - //remove hash and alias - TQValueList tList( item.tlvList() ); - TLV t = Oscar::findTLV( tList, 0x00D5 ); - if ( t ) - tList.remove( t ); - - item.setTLVList( tList ); - //s is old, item is new. modification will occur - engine()->modifySSIItem( s, item ); - } - } - else - { - TQFile iconFile( photoPath ); - iconFile.open( IO_ReadOnly ); - - KMD5 iconHash; - iconHash.update( *TQT_TQIODEVICE(&iconFile) ); - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "hash is :" << iconHash.hexDigest() << endl; - - //find old item, create updated item - if ( !item ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "no existing icon hash item in ssi. creating new" << endl; - - TLV t; - t.type = 0x00D5; - t.data.resize( 18 ); - t.data[0] = 0x00; - t.data[1] = 0x10; - memcpy(t.data.data() + 2, iconHash.rawDigest(), 16); - t.length = t.data.size(); - - TQValueList list; - list.append( t ); - - Oscar::SSI s( "1", 0, ssi->nextContactId(), ROSTER_BUDDYICONS, list ); - - //item is a non-valid ssi item, so the function will add an item - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "setting new icon item" << endl; - engine()->modifySSIItem( item, s ); - } - else - { //found an item - Oscar::SSI s(item); - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "modifying old item in ssi." << endl; - TQValueList tList( item.tlvList() ); - - TLV t = Oscar::findTLV( tList, 0x00D5 ); - if ( t ) - tList.remove( t ); - else - t.type = 0x00D5; - - t.data.resize( 18 ); - t.data[0] = 0x00; - t.data[1] = 0x10; - memcpy(t.data.data() + 2, iconHash.rawDigest(), 16); - t.length = t.data.size(); - tList.append( t ); - - item.setTLVList( tList ); - //s is old, item is new. modification will occur - engine()->modifySSIItem( s, item ); - } - iconFile.close(); - } -} - -void AIMAccount::slotJoinChat() -{ - if ( !isConnected() ) - { - KMessageBox::sorry( Kopete::UI::Global::mainWidget(), - i18n( "Joining an AIM chat room is not possible because " - "you are not connected." ), - i18n( "Unable to Join AIM Chat Room" ) ); - return; - } - - //get the exchange info - //create the dialog - //join the chat room - if ( !m_joinChatDialog ) - { - m_joinChatDialog = new AIMJoinChatUI( this, false, Kopete::UI::Global::mainWidget() ); - TQObject::connect( m_joinChatDialog, TQT_SIGNAL( closing( int ) ), - this, TQT_SLOT( joinChatDialogClosed( int ) ) ); - TQValueList list = engine()->chatExchangeList(); - m_joinChatDialog->setExchangeList( list ); - m_joinChatDialog->show(); - } - else - m_joinChatDialog->raise(); -} - -void AIMAccount::slotGoOnline() -{ - if ( myself()->onlineStatus().status() == Kopete::OnlineStatus::Away ) - { - kdDebug(14152) << k_funcinfo << accountId() << " was away. welcome back." << endl; - engine()->setStatus( Client::Online ); - myself()->removeProperty( Kopete::Global::Properties::self()->awayMessage() ); - } - else if ( myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline ) - { - kdDebug(14152) << k_funcinfo << accountId() << " was offline. time to connect" << endl; - OscarAccount::connect(); - } - else - { - kdDebug(14152) << k_funcinfo << accountId() << " is already online, doing nothing" << endl; - } -} - -void AIMAccount::slotGoAway(const TQString &message) -{ - kdDebug(14152) << k_funcinfo << message << endl; - setAway(true, message); -} - -void AIMAccount::joinChatDialogClosed( int code ) -{ - if ( code == TQDialog::Accepted ) - { - //join the chat - kdDebug(14152) << k_funcinfo << "chat accepted." << endl; - engine()->joinChatRoom( m_joinChatDialog->roomName(), - m_joinChatDialog->exchange().toInt() ); - } - - m_joinChatDialog->delayedDestruct(); - m_joinChatDialog = 0L; -} - -void AIMAccount::loginActions() -{ - OscarAccount::loginActions(); - - using namespace AIM::PrivacySettings; - int privacySetting = this->configGroup()->readNumEntry( "PrivacySetting", AllowAll ); - this->setPrivacySettings( privacySetting ); -} - -void AIMAccount::disconnected( DisconnectReason reason ) -{ - kdDebug( OSCAR_AIM_DEBUG ) << k_funcinfo << "Attempting to set status offline" << endl; - myself()->setOnlineStatus( static_cast( protocol() )->statusOffline ); - - TQDictIterator it( contacts() ); - for( ; it.current(); ++it ) - { - OscarContact* oc = dynamic_cast( it.current() ); - if ( oc ) - oc->setOnlineStatus( static_cast( protocol() )->statusOffline ); - } - - OscarAccount::disconnected( reason ); -} - -void AIMAccount::messageReceived( const Oscar::Message& message ) -{ - kdDebug(14152) << k_funcinfo << " Got a message, calling OscarAccount::messageReceived" << endl; - // Want to call the parent to do everything else - if ( message.type() != 0x0003 ) - { - OscarAccount::messageReceived(message); - - // Check to see if our status is away, and send an away message - // Might be duplicate code from the parent class to get some needed information - // Perhaps a refactoring is needed. - kdDebug(14152) << k_funcinfo << "Checking to see if I'm online.." << endl; - if( myself()->onlineStatus().status() == Kopete::OnlineStatus::Away ) - { - TQString sender = Oscar::normalize( message.sender() ); - AIMContact* aimSender = static_cast ( contacts()[sender] ); //should exist now - if ( !aimSender ) - { - kdWarning(OSCAR_RAW_DEBUG) << "For some reason, could not get the contact " - << "That this message is from: " << message.sender() << ", Discarding message" << endl; - return; - } - // Create, or get, a chat session with the contact - Kopete::ChatSession* chatSession = aimSender->manager( Kopete::Contact::CanCreate ); - - // get the away message we have set - AIMMyselfContact* myContact = static_cast ( myself() ); - TQString msg = myContact->lastAwayMessage(); - kdDebug(14152) << k_funcinfo << "Got away message: " << msg << endl; - // Create the message - Kopete::Message chatMessage( myself(), aimSender, msg, Kopete::Message::Outbound, - Kopete::Message::RichText ); - kdDebug(14152) << k_funcinfo << "Sending autoresponse" << endl; - // Send the message - aimSender->sendAutoResponse( chatMessage ); - } - } - - if ( message.type() == 0x0003 ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "have chat message" << endl; - //handle chat room messages seperately - TQValueList chats = Kopete::ChatSessionManager::self()->sessions(); - TQValueList::iterator it, itEnd = chats.end(); - for ( it = chats.begin(); it != itEnd; ++it ) - { - Kopete::ChatSession* kcs = ( *it ); - AIMChatSession* session = dynamic_cast( kcs ); - if ( !session ) - continue; - - if ( session->exchange() == message.exchange() && - Oscar::normalize( session->roomName() ) == - Oscar::normalize( message.chatRoom() ) ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "found chat session for chat room" << endl; - Kopete::Contact* ocSender = contacts()[Oscar::normalize( message.sender() )]; - //sanitize; - TQString sanitizedMsg = sanitizedMessage( message.text( defaultCodec() ) ); - - Kopete::ContactPtrList me; - me.append( myself() ); - Kopete::Message chatMessage( message.timestamp(), ocSender, me, sanitizedMsg, - Kopete::Message::Inbound, Kopete::Message::RichText ); - - session->appendMessage( chatMessage ); - } - } - } -} - -void AIMAccount::connectedToChatRoom( WORD exchange, const TQString& room ) -{ - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Creating chat room session" << endl; - Kopete::ContactPtrList emptyList; - AIMMyselfContact* me = static_cast( myself() ); - AIMChatSession* session = dynamic_cast( me->manager( Kopete::Contact::CanCreate, - exchange, room ) ); - session->setDisplayName( room ); - if ( session->view( true ) ) - session->raiseView(); -} - -void AIMAccount::userJoinedChat( WORD exchange, const TQString& room, const TQString& contact ) -{ - if ( Oscar::normalize( contact ) == Oscar::normalize( myself()->contactId() ) ) - return; - - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "user " << contact << " has joined the chat" << endl; - TQValueList chats = Kopete::ChatSessionManager::self()->sessions(); - TQValueList::iterator it, itEnd = chats.end(); - for ( it = chats.begin(); it != itEnd; ++it ) - { - Kopete::ChatSession* kcs = ( *it ); - AIMChatSession* session = dynamic_cast( kcs ); - if ( !session ) - continue; - - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << session->exchange() << " " << exchange << endl; - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << session->roomName() << " " << room << endl; - if ( session->exchange() == exchange && session->roomName() == room ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "found correct chat session" << endl; - Kopete::Contact* c; - if ( contacts()[Oscar::normalize( contact )] ) - c = contacts()[Oscar::normalize( contact )]; - else - { - Kopete::MetaContact* mc = addContact( Oscar::normalize( contact ), - contact, 0, Kopete::Account::Temporary ); - if ( !mc ) - kdWarning(OSCAR_AIM_DEBUG) << "Unable to add contact for chat room" << endl; - - c = mc->contacts().first(); - c->setNickName( contact ); - } - - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "adding contact" << endl; - session->addContact( c, static_cast( protocol() )->statusOnline, true /* suppress */ ); - } - } -} - -void AIMAccount::userLeftChat( WORD exchange, const TQString& room, const TQString& contact ) -{ - if ( Oscar::normalize( contact ) == Oscar::normalize( myself()->contactId() ) ) - return; - - TQValueList chats = Kopete::ChatSessionManager::self()->sessions(); - TQValueList::iterator it, itEnd = chats.end(); - for ( it = chats.begin(); it != itEnd; ++it ) - { - Kopete::ChatSession* kcs = ( *it ); - AIMChatSession* session = dynamic_cast( kcs ); - if ( !session ) - continue; - - if ( session->exchange() == exchange && session->roomName() == room ) - { - //delete temp contact - Kopete::Contact* c = contacts()[Oscar::normalize( contact )]; - if ( !c ) - { - kdWarning(OSCAR_AIM_DEBUG) << k_funcinfo << "couldn't find the contact that's left the chat!" << endl; - continue; - } - session->removeContact( c ); - Kopete::MetaContact* mc = c->metaContact(); - if ( mc->isTemporary() ) - { - mc->removeContact( c ); - delete c; - delete mc; - } - } - } -} - - -void AIMAccount::connectWithPassword( const TQString & ) -{ - kdDebug(14152) << k_funcinfo << "accountId='" << accountId() << "'" << endl; - - // Get the screen name for this account - TQString screenName = accountId(); - TQString server = configGroup()->readEntry( "Server", TQString::fromLatin1( "login.oscar.aol.com" ) ); - uint port = configGroup()->readNumEntry( "Port", 5190 ); - - Connection* c = setupConnection( server, port ); - - TQString _password = password().cachedValue(); - if ( _password.isEmpty() ) - { - kdDebug(14150) << "Kopete is unable to attempt to sign-on to the " - << "AIM network because no password was specified in the " - << "preferences." << endl; - } - else if ( myself()->onlineStatus() == static_cast( protocol() )->statusOffline ) - { - kdDebug(14152) << k_funcinfo << "Logging in as " << accountId() << endl ; - updateVersionUpdaterStamp(); - engine()->start( server, port, accountId(), _password ); - engine()->connectToServer( c, server, true /* doAuth */ ); - myself()->setOnlineStatus( static_cast( protocol() )->statusConnecting ); - } -} - -void AIMAccount::slotSetVisiblility() -{ - if( !isConnected() ) - { - KMessageBox::sorry( Kopete::UI::Global::mainWidget(), - i18n("You must be online to set users visibility."), - i18n("ICQ Plugin") ); - return; - } - - if ( !m_visibilityDialog ) - { - m_visibilityDialog = new OscarVisibilityDialog( engine(), Kopete::UI::Global::mainWidget() ); - TQObject::connect( m_visibilityDialog, TQT_SIGNAL( closing() ), - this, TQT_SLOT( slotVisibilityDialogClosed() ) ); - - //add all contacts; - OscarVisibilityDialog::ContactMap contactMap; - TQMap revContactMap; - - TQValueList contactList = engine()->ssiManager()->contactList(); - TQValueList::const_iterator it, cEnd = contactList.constEnd(); - - for ( it = contactList.constBegin(); it != cEnd; ++it ) - { - TQString contactId = ( *it ).name(); - - OscarContact* oc = dynamic_cast( contacts()[( *it ).name()] ); - if ( oc ) - { - contactMap.insert( oc->nickName(), contactId ); - revContactMap.insert( contactId, oc->nickName() ); - } - else - { - contactMap.insert( contactId, contactId ); - revContactMap.insert( contactId, contactId ); - } - } - m_visibilityDialog->addContacts( contactMap ); - - //add contacts from visible list - TQStringList tmpList; - - contactList = engine()->ssiManager()->visibleList(); - cEnd = contactList.constEnd(); - - for ( it = contactList.constBegin(); it != cEnd; ++it ) - tmpList.append( revContactMap[( *it ).name()] ); - - m_visibilityDialog->addVisibleContacts( tmpList ); - - //add contacts from invisible list - tmpList.clear(); - - contactList = engine()->ssiManager()->invisibleList(); - cEnd = contactList.constEnd(); - - for ( it = contactList.constBegin(); it != cEnd; ++it ) - tmpList.append( revContactMap[( *it ).name()] ); - - m_visibilityDialog->addInvisibleContacts( tmpList ); - - m_visibilityDialog->resize( 550, 350 ); - m_visibilityDialog->show(); - } - else - { - m_visibilityDialog->raise(); - } -} - -void AIMAccount::slotVisibilityDialogClosed() -{ - m_visibilityDialog->delayedDestruct(); - m_visibilityDialog = 0L; -} - -void AIMAccount::setPrivacySettings( int privacy ) -{ - using namespace AIM::PrivacySettings; - - BYTE privacyByte = 0x01; - DWORD userClasses = 0xFFFFFFFF; - - switch ( privacy ) - { - case AllowAll: - privacyByte = 0x01; - break; - case BlockAll: - privacyByte = 0x02; - break; - case AllowPremitList: - privacyByte = 0x03; - break; - case BlockDenyList: - privacyByte = 0x04; - break; - case AllowMyContacts: - privacyByte = 0x05; - break; - case BlockAIM: - privacyByte = 0x01; - userClasses = 0x00000004; - break; - } - - this->setPrivacyTLVs( privacyByte, userClasses ); -} - -void AIMAccount::setPrivacyTLVs( BYTE privacy, DWORD userClasses ) -{ - SSIManager* ssi = engine()->ssiManager(); - Oscar::SSI item = ssi->findItem( TQString(), ROSTER_VISIBILITY ); - - TQValueList tList; - - tList.append( TLV( 0x00CA, 1, (char *)&privacy ) ); - tList.append( TLV( 0x00CB, sizeof(userClasses), (char *)&userClasses ) ); - - if ( !item ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Adding new privacy TLV item" << endl; - Oscar::SSI s( TQString(), 0, ssi->nextContactId(), ROSTER_VISIBILITY, tList ); - engine()->modifySSIItem( item, s ); - } - else - { //found an item - Oscar::SSI s(item); - - if ( Oscar::uptateTLVs( s, tList ) == true ) - { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Updating privacy TLV item" << endl; - engine()->modifySSIItem( item, s ); - } - } -} - -#include "aimaccount.moc" -//kate: tab-width 4; indent-mode csands; diff --git a/kopete/protocols/oscar/aim/aimaccount.h b/kopete/protocols/oscar/aim/aimaccount.h deleted file mode 100644 index 63adeac7..00000000 --- a/kopete/protocols/oscar/aim/aimaccount.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - AIMAccount - Oscar Protocol Account - - Copyright (c) 2002 by Chris TenHarmsel - - Kopete (c) 2002 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* - -*/ - -#ifndef AIMACCOUNT_H -#define AIMACCOUNT_H - -#include -#include -#include -#include "oscartypeclasses.h" - -#include "oscaraccount.h" -#include "oscarmyselfcontact.h" - -namespace AIM -{ - namespace PrivacySettings - { - enum { AllowAll = 0, AllowMyContacts, AllowPremitList, BlockAll, BlockAIM, BlockDenyList }; - } -} - -namespace Kopete -{ -class Contact; -class Group; -class ChatSession; -} - -class TDEAction; -class OscarContact; -class AIMContact; -class AIMAccount; -class AIMJoinChatUI; -class AIMChatSession; -class OscarVisibilityDialog; - -class AIMMyselfContact : public OscarMyselfContact -{ -Q_OBJECT - -public: - AIMMyselfContact( AIMAccount *acct ); - void userInfoUpdated(); - void setOwnProfile( const TQString& newProfile ); - TQString userProfile(); - void setLastAwayMessage( const TQString& msg) {m_lastAwayMessage = msg;} - TQString lastAwayMessage() { return m_lastAwayMessage; }; - - virtual Kopete::ChatSession* manager( Kopete::Contact::CanCreateFlags = Kopete::Contact::CannotCreate, - WORD exchange = 0, const TQString& room = TQString()); - -public slots: - void sendMessage( Kopete::Message&, Kopete::ChatSession* session ); - void chatSessionDestroyed( Kopete::ChatSession* ); - -private: - TQString m_profileString; - AIMAccount* m_acct; - /** - * There has GOT to be a better way to get this away message - */ - TQString m_lastAwayMessage; - TQValueList m_chatRoomSessions; - - -}; - -class AIMAccount : public OscarAccount -{ -Q_OBJECT - - -public: - AIMAccount(Kopete::Protocol *parent, TQString accountID, const char *name=0L); - virtual ~AIMAccount(); - - // Accessor method for the action menu - virtual TDEActionMenu* actionMenu(); - - void setAway(bool away, const TQString &awayReason = TQString() ); - - virtual void connectWithPassword( const TQString &password ); - - void setUserProfile(const TQString &profile); - - void setPrivacySettings( int privacy ); - -public slots: - /** Reimplementation from Kopete::Account */ - void setOnlineStatus( const Kopete::OnlineStatus& status, const TQString& reason = TQString() ); - void slotEditInfo(); - void slotGoOnline(); - - void slotGlobalIdentityChanged( const TQString&, const TQVariant& ); - void slotBuddyIconChanged(); - - void slotJoinChat(); - -protected slots: - void slotGoAway(const TQString&); - void joinChatDialogClosed( int ); - - virtual void loginActions(); - virtual void disconnected( Kopete::Account::DisconnectReason reason ); - virtual void messageReceived( const Oscar::Message& message ); - - void connectedToChatRoom( WORD exchange, const TQString& roomName ); - void userJoinedChat( Oscar::WORD exchange, const TQString& room, const TQString& contact ); - void userLeftChat( Oscar::WORD exchange, const TQString& room, const TQString& contact ); - - void slotSetVisiblility(); - void slotVisibilityDialogClosed(); - -protected: - - /** - * Implement virtual method from OscarAccount - * This allows OscarAccount to take care of adding new contacts - */ - OscarContact *createNewContact( const TQString &contactId, Kopete::MetaContact *parentContact, const SSI& ssiItem ); - - TQString sanitizedMessage( const TQString& message ); - -private: - // Set privacy tlv item - void setPrivacyTLVs( BYTE privacy, DWORD userClasses ); - - AIMJoinChatUI* m_joinChatDialog; - OscarVisibilityDialog* m_visibilityDialog; -}; -#endif -//kate: tab-width 4; indent-mode csands; diff --git a/kopete/protocols/oscar/aim/aimchatsession.cpp b/kopete/protocols/oscar/aim/aimchatsession.cpp deleted file mode 100644 index 10938a6a..00000000 --- a/kopete/protocols/oscar/aim/aimchatsession.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// aimchatsession.cpp - -// Copyright (C) 2005 Matt Rogers - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA -// 02110-1301, USA. - - -#include "aimchatsession.h" -#include "kopetecontact.h" -#include "kopetechatsessionmanager.h" -#include "kopeteprotocol.h" -#include "client.h" - -AIMChatSession::AIMChatSession( const Kopete::Contact* user, Kopete::ContactPtrList others, - Kopete::Protocol* protocol, Oscar::WORD exchange, - const TQString& room ) - - : Kopete::ChatSession( user, others, protocol, "AIMChatSession" ) -{ - Kopete::ChatSessionManager::self()->registerChatSession( this ); - setInstance( protocol->instance() ); - setMayInvite( false ); - m_exchange = exchange; - m_roomName = room; - m_engine = 0; -} - -AIMChatSession::~AIMChatSession() -{ - m_engine->disconnectChatRoom( m_exchange, m_roomName ); -} - -void AIMChatSession::setEngine( Client* engine ) -{ - m_engine = engine; -} - -TQString AIMChatSession::roomName() const -{ - - return m_roomName; -} - -void AIMChatSession::setRoomName( const TQString& room ) -{ - m_roomName = room; -} - -Oscar::WORD AIMChatSession::exchange() const -{ - return m_exchange; -} - -void AIMChatSession::setExchange( Oscar::WORD exchange ) -{ - m_exchange = exchange; -} - - -#include "aimchatsession.moc" diff --git a/kopete/protocols/oscar/aim/aimchatsession.h b/kopete/protocols/oscar/aim/aimchatsession.h deleted file mode 100644 index b4e78e3d..00000000 --- a/kopete/protocols/oscar/aim/aimchatsession.h +++ /dev/null @@ -1,78 +0,0 @@ -// aimchatsession.h -// Copyright (C) 2005 Matt Rogers - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA -// 02110-1301, USA. - -#ifndef AIMCHATSESSION_H -#define AIMCHATSESSION_H - -#include "kopetechatsession.h" -#include "oscartypes.h" - -class Client; - -class AIMChatSession : public Kopete::ChatSession -{ -Q_OBJECT - -public: - AIMChatSession( const Kopete::Contact* contact, Kopete::ContactPtrList others, - Kopete::Protocol* protocol, Oscar::WORD exchange = 0, - const TQString& room = TQString() ); - virtual ~AIMChatSession(); - - /** - * Set the engine to use so that we can disconnect from the chat service - * properly - */ - void setEngine( Client* engine ); - - /** - * Get the name of the AIM chat room represented by - * this ChatSession object - * @return the name of the chat room - */ - TQString roomName() const; - - /** - * Set the name of the AIM chat room represented by - * this ChatSession object - * @param room the name of the AIM chat room - */ - void setRoomName( const TQString& room ); - - /** - * Get the exchange of the AIM chat room represented by - * this ChatSession object - * @return the exchange of the chat room - */ - Oscar::WORD exchange() const; - - /** - * Set the exchange of the AIM chat room represented by - * this ChatSession object - * @param exchange the exchange of the AIM chat room - */ - void setExchange( Oscar::WORD exchange ); - -private: - TQString m_roomName; - Oscar::WORD m_exchange; - Client* m_engine; -}; - - -#endif diff --git a/kopete/protocols/oscar/aim/aimcontact.cpp b/kopete/protocols/oscar/aim/aimcontact.cpp deleted file mode 100644 index 2fa79bf1..00000000 --- a/kopete/protocols/oscar/aim/aimcontact.cpp +++ /dev/null @@ -1,520 +0,0 @@ -/* - aimcontact.cpp - Oscar Protocol Plugin - - Copyright (c) 2003 by Will Stephenson - Kopete (c) 2002-2004 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* -*/ - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "kopeteaway.h" -#include "kopetechatsession.h" -#include "kopeteuiglobal.h" -#include "kopetemetacontact.h" - -//liboscar -#include "client.h" -#include "oscartypes.h" -#include "oscarutils.h" -#include "ssimanager.h" - -#include "aimprotocol.h" -#include "aimuserinfo.h" -#include "aimcontact.h" -#include "aimaccount.h" - -AIMContact::AIMContact( Kopete::Account* account, const TQString& name, Kopete::MetaContact* parent, - const TQString& icon, const Oscar::SSI& ssiItem ) -: OscarContact(account, name, parent, icon, ssiItem ) -{ - mProtocol=static_cast(protocol()); - setOnlineStatus( mProtocol->statusOffline ); - - m_infoDialog = 0L; - m_warnUserAction = 0L; - mUserProfile=""; - m_haveAwayMessage = false; - m_mobile = false; - // Set the last autoresponse time to the current time yesterday - m_lastAutoresponseTime = TQDateTime::currentDateTime().addDays(-1); - - TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedUserInfo( const TQString&, const UserDetails& ) ), - this, TQT_SLOT( userInfoUpdated( const TQString&, const UserDetails& ) ) ); - TQObject::connect( mAccount->engine(), TQT_SIGNAL( userIsOffline( const TQString& ) ), - this, TQT_SLOT( userOffline( const TQString& ) ) ); - TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedAwayMessage( const TQString&, const TQString& ) ), - this, TQT_SLOT( updateAwayMessage( const TQString&, const TQString& ) ) ); - TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedProfile( const TQString&, const TQString& ) ), - this, TQT_SLOT( updateProfile( const TQString&, const TQString& ) ) ); - TQObject::connect( mAccount->engine(), TQT_SIGNAL( userWarned( const TQString&, TQ_UINT16, TQ_UINT16 ) ), - this, TQT_SLOT( gotWarning( const TQString&, TQ_UINT16, TQ_UINT16 ) ) ); - TQObject::connect( mAccount->engine(), TQT_SIGNAL( haveIconForContact( const TQString&, TQByteArray ) ), - this, TQT_SLOT( haveIcon( const TQString&, TQByteArray ) ) ); - TQObject::connect( mAccount->engine(), TQT_SIGNAL( iconServerConnected() ), - this, TQT_SLOT( requestBuddyIcon() ) ); - TQObject::connect( this, TQT_SIGNAL( featuresUpdated() ), this, TQT_SLOT( updateFeatures() ) ); -} - -AIMContact::~AIMContact() -{ -} - -bool AIMContact::isReachable() -{ - return true; -} - -TQPtrList *AIMContact::customContextMenuActions() -{ - - TQPtrList *actionCollection = new TQPtrList(); - if ( !m_warnUserAction ) - { - m_warnUserAction = new TDEAction( i18n( "&Warn User" ), 0, this, TQT_SLOT( warnUser() ), this, "warnAction" ); - } - m_actionVisibleTo = new TDEToggleAction(i18n("Always &Visible To"), "", 0, - this, TQT_SLOT(slotVisibleTo()), this, "actionVisibleTo"); - m_actionInvisibleTo = new TDEToggleAction(i18n("Always &Invisible To"), "", 0, - this, TQT_SLOT(slotInvisibleTo()), this, "actionInvisibleTo"); - - bool on = account()->isConnected(); - - m_warnUserAction->setEnabled( on ); - - m_actionVisibleTo->setEnabled(on); - m_actionInvisibleTo->setEnabled(on); - - SSIManager* ssi = account()->engine()->ssiManager(); - m_actionVisibleTo->setChecked( ssi->findItem( m_ssiItem.name(), ROSTER_VISIBLE )); - m_actionInvisibleTo->setChecked( ssi->findItem( m_ssiItem.name(), ROSTER_INVISIBLE )); - - actionCollection->append( m_warnUserAction ); - - actionCollection->append(m_actionVisibleTo); - actionCollection->append(m_actionInvisibleTo); - - - return actionCollection; -} - -const TQString AIMContact::awayMessage() -{ - return property(mProtocol->awayMessage).value().toString(); -} - -void AIMContact::setAwayMessage(const TQString &message) -{ - kdDebug(14152) << k_funcinfo << - "Called for '" << contactId() << "', away msg='" << message << "'" << endl; - TQString filteredMessage = message; - filteredMessage.replace( - TQRegExp(TQString::fromLatin1("<[hH][tT][mM][lL].*>(.*)")), - TQString::fromLatin1("\\1")); - filteredMessage.replace( - TQRegExp(TQString::fromLatin1("<[bB][oO][dD][yY].*>(.*)")), - TQString::fromLatin1("\\1") ); - TQRegExp fontRemover( TQString::fromLatin1("<[fF][oO][nN][tT].*>(.*)") ); - fontRemover.setMinimal(true); - while ( filteredMessage.find( fontRemover ) != -1 ) - filteredMessage.replace( fontRemover, TQString::fromLatin1("\\1") ); - setProperty(mProtocol->awayMessage, filteredMessage); -} - -int AIMContact::warningLevel() const -{ - return m_warningLevel; -} - -void AIMContact::updateSSIItem() -{ - if ( m_ssiItem.type() != 0xFFFF && m_ssiItem.waitingAuth() == false && - onlineStatus() == Kopete::OnlineStatus::Unknown ) - { - //make sure they're offline - setOnlineStatus( static_cast( protocol() )->statusOffline ); - } -} - -void AIMContact::slotUserInfo() -{ - if ( !m_infoDialog) - { - m_infoDialog = new AIMUserInfoDialog( this, static_cast( account() ), false, Kopete::UI::Global::mainWidget(), 0 ); - if( !m_infoDialog ) - return; - connect( m_infoDialog, TQT_SIGNAL( finished() ), this, TQT_SLOT( closeUserInfoDialog() ) ); - m_infoDialog->show(); - if ( mAccount->isConnected() ) - { - mAccount->engine()->requestAIMProfile( contactId() ); - mAccount->engine()->requestAIMAwayMessage( contactId() ); - } - } - else - m_infoDialog->raise(); -} - -void AIMContact::userInfoUpdated( const TQString& 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. - TQString 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 = ( TDEApplication::random() % 10 ) * 1000; - kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "updating buddy icon in " << time/1000 << " seconds" << endl; - TQTimer::singleShot( time, this, TQT_SLOT( requestBuddyIcon() ) ); - } - - OscarContact::userInfoUpdated( contact, details ); -} - -void AIMContact::userOnline( const TQString& userId ) -{ - if ( Oscar::normalize( userId ) == Oscar::normalize( contactId() ) ) - { - kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Getting more contact info" << endl; - setOnlineStatus( mProtocol->statusOnline ); - } -} - -void AIMContact::userOffline( const TQString& userId ) -{ - if ( Oscar::normalize( userId ) == Oscar::normalize( contactId() ) ) - { - setOnlineStatus( mProtocol->statusOffline ); - removeProperty( mProtocol->awayMessage ); - } -} - -void AIMContact::updateAwayMessage( const TQString& contact, const TQString& message ) -{ - if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) - return; - else - { - if ( message.isEmpty() ) - { - removeProperty( mProtocol->awayMessage ); - if ( !m_mobile ) - setOnlineStatus( mProtocol->statusOnline ); - else - setOnlineStatus( mProtocol->statusWirelessOnline ); - m_haveAwayMessage = false; - } - else - { - m_haveAwayMessage = true; - setAwayMessage( message ); - if ( !m_mobile ) - setOnlineStatus( mProtocol->statusAway ); - else - setOnlineStatus( mProtocol->statusWirelessAway ); - } - } - - emit updatedProfile(); -} - -void AIMContact::updateProfile( const TQString& contact, const TQString& profile ) -{ - if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) - return; - - setProperty( mProtocol->clientProfile, profile ); - emit updatedProfile(); -} - -void AIMContact::gotWarning( const TQString& contact, TQ_UINT16 increase, TQ_UINT16 newLevel ) -{ - //somebody just got bitchslapped! :O - Q_UNUSED( increase ); - if ( Oscar::normalize( contact ) == Oscar::normalize( contactId() ) ) - m_warningLevel = newLevel; - - //TODO add a KNotify event after merge to HEAD -} - -void AIMContact::requestBuddyIcon() -{ - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Updating buddy icon for " << contactId() << endl; - if ( m_details.buddyIconHash().size() > 0 ) - { - account()->engine()->requestBuddyIcon( contactId(), m_details.buddyIconHash(), - m_details.iconCheckSumType() ); - } -} - -void AIMContact::haveIcon( const TQString& user, TQByteArray icon ) -{ - if ( Oscar::normalize( user ) != Oscar::normalize( contactId() ) ) - return; - - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Updating icon for " << contactId() << endl; - TQImage buddyIcon( icon ); - if ( buddyIcon.isNull() ) - { - kdWarning(OSCAR_AIM_DEBUG) << k_funcinfo << "Failed to convert buddy icon to TQImage" << endl; - return; - } - - setProperty( Kopete::Global::Properties::self()->photo(), buddyIcon ); -} - -void AIMContact::closeUserInfoDialog() -{ - m_infoDialog->delayedDestruct(); - m_infoDialog = 0L; -} - -void AIMContact::warnUser() -{ - TQString nick = property( Kopete::Global::Properties::self()->nickName() ).value().toString(); - TQString message = i18n( "Would you like to warn %1 anonymously or with your name?
" \ - "(Warning a user on AIM will result in a \"Warning Level\"" \ - " increasing for the user you warn. Once this level has reached a" \ - " certain point, they will not be able to sign on. Please do not abuse" \ - " this function, it is meant for legitimate practices.)
" ).arg( nick ); - - - int result = KMessageBox::questionYesNoCancel( Kopete::UI::Global::mainWidget(), message, - i18n( "Warn User %1?" ).arg( nick ), - i18n( "Warn Anonymously" ), i18n( "Warn" ) ); - - if ( result == KMessageBox::Yes ) - mAccount->engine()->sendWarning( contactId(), true); - else if ( result == KMessageBox::No ) - mAccount->engine()->sendWarning( contactId(), false); -} - -void AIMContact::slotVisibleTo() -{ - account()->engine()->setVisibleTo( contactId(), m_actionVisibleTo->isChecked() ); -} - -void AIMContact::slotInvisibleTo() -{ - account()->engine()->setInvisibleTo( contactId(), m_actionInvisibleTo->isChecked() ); -} - -void AIMContact::slotSendMsg(Kopete::Message& message, Kopete::ChatSession *) -{ - Oscar::Message msg; - TQString s; - - if (message.plainBody().isEmpty()) // no text, do nothing - return; - //okay, now we need to change the message.escapedBody from real HTML to aimhtml. - //looking right now for docs on that "format". - //looks like everything except for alignment codes comes in the format of spans - - //font-style:italic -> - //font-weight:600 -> (anything > 400 should be , 400 is not bold) - //text-decoration:underline -> - //font-family: -> - //font-size:xxpt -> - - s=message.escapedBody(); - s.replace ( TQRegExp( TQString::fromLatin1("([^<]*)")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); - - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("\\2")); - - //okay now change the to - - //0-9 are size 1 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //10-11 are size 2 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //12-13 are size 3 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //14-16 are size 4 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //17-22 are size 5 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); - //23-29 are size 6 - s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); - //30- (and any I missed) are size 7 - s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); - - // strip left over line break - s.remove(TQRegExp(TQString::fromLatin1("]*>$"))); - - s.replace ( TQRegExp ( TQString::fromLatin1("")), TQString::fromLatin1("
") ); - - // strip left over line break - s.remove( TQRegExp( TQString::fromLatin1( "
$" ) ) ); - - kdDebug(14190) << k_funcinfo << "sending " - << s << endl; - - // XXX Need to check for message size? - - if ( m_details.hasCap( CAP_UTF8 ) ) - msg.setText( Oscar::Message::UCS2, s ); - else - msg.setText( Oscar::Message::UserDefined, s, contactCodec() ); - - msg.setReceiver(mName); - msg.setTimestamp(message.timestamp()); - msg.setType(0x01); - - mAccount->engine()->sendMessage(msg); - - // Show the message we just sent in the chat window - manager(Kopete::Contact::CanCreate)->appendMessage(message); - manager(Kopete::Contact::CanCreate)->messageSucceeded(); -} - -void AIMContact::updateFeatures() -{ - setProperty( static_cast(protocol())->clientFeatures, m_clientFeatures ); -} - -void AIMContact::sendAutoResponse(Kopete::Message& msg) -{ - // The target time is 2 minutes later than the last message - int delta = m_lastAutoresponseTime.secsTo( TQDateTime::currentDateTime() ); - kdDebug(14152) << k_funcinfo << "Last autoresponse time: " << m_lastAutoresponseTime << endl; - kdDebug(14152) << k_funcinfo << "Current time: " << TQDateTime::currentDateTime() << endl; - kdDebug(14152) << k_funcinfo << "Difference: " << delta << endl; - // Check to see if we're past that time - if(delta > 120) - { - kdDebug(14152) << k_funcinfo << "Sending auto response" << endl; - - // This code was yoinked straight from OscarContact::slotSendMsg() - // If only that slot wasn't private, but I'm not gonna change it right now. - Oscar::Message message; - - if ( m_details.hasCap( CAP_UTF8 ) ) - { - message.setText( Oscar::Message::UCS2, msg.plainBody() ); - } - else - { - TQTextCodec* codec = contactCodec(); - message.setText( Oscar::Message::UserDefined, msg.plainBody(), codec ); - } - - message.setTimestamp( msg.timestamp() ); - message.setSender( mAccount->accountId() ); - message.setReceiver( mName ); - message.setType( 0x01 ); - - // isAuto defaults to false - mAccount->engine()->sendMessage( message, true); - kdDebug(14152) << k_funcinfo << "Sent auto response" << endl; - manager(Kopete::Contact::CanCreate)->appendMessage(msg); - manager(Kopete::Contact::CanCreate)->messageSucceeded(); - // Update the last autoresponse time - m_lastAutoresponseTime = TQDateTime::currentDateTime(); - } - else - { - kdDebug(14152) << k_funcinfo << "Not enough time since last autoresponse, NOT sending" << endl; - } -} -#include "aimcontact.moc" -//kate: tab-width 4; indent-mode csands; diff --git a/kopete/protocols/oscar/aim/aimcontact.h b/kopete/protocols/oscar/aim/aimcontact.h deleted file mode 100644 index eea346ac..00000000 --- a/kopete/protocols/oscar/aim/aimcontact.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - aimcontact.h - Oscar Protocol Plugin - - Copyright (c) 2003 by Will Stephenson - Copyright (c) 2004 by Matt Rogers - Kopete (c) 2002-2004 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* -*/ - -#ifndef AIMCONTACT_H -#define AIMCONTACT_H - -#include - -#include "oscarcontact.h" - - -namespace Kopete -{ -class ChatSession; -} - -class AIMAccount; -class AIMProtocol; -class AIMUserInfoDialog; - -class AIMContact : public OscarContact -{ -Q_OBJECT - - -public: - AIMContact( Kopete::Account*, const TQString&, Kopete::MetaContact*, - const TQString& icon = TQString(), const Oscar::SSI& ssiItem = Oscar::SSI() ); - virtual ~AIMContact(); - - bool isReachable(); - TQPtrList *customContextMenuActions(); - - const TQString &userProfile() { return mUserProfile; } - - virtual const TQString awayMessage(); - virtual void setAwayMessage( const TQString &message ); - - int warningLevel() const; - - /** - * Gets the last time an autoresponse was sent to this contact - * @returns TQDateTime Object that represents the date/time - */ - TQDateTime lastAutoResponseTime() {return m_lastAutoresponseTime;} - - /** Sends an auto response to this contact */ - virtual void sendAutoResponse(Kopete::Message& msg); - -public slots: - void updateSSIItem(); - void slotUserInfo(); - void userInfoUpdated( const TQString& contact, const UserDetails& details ); - void userOnline( const TQString& userId ); - void userOffline( const TQString& userId ); - void updateAwayMessage( const TQString& userId, const TQString& message ); - void updateProfile( const TQString& contact, const TQString& profile ); - void gotWarning( const TQString& contact, TQ_UINT16, TQ_UINT16 ); - -signals: - void updatedProfile(); - -protected slots: - virtual void slotSendMsg(Kopete::Message& message, Kopete::ChatSession *); - virtual void updateFeatures(); - -private slots: - void requestBuddyIcon(); - void haveIcon( const TQString&, TQByteArray ); - void closeUserInfoDialog(); - void warnUser(); - - void slotVisibleTo(); - void slotInvisibleTo(); - -private: - AIMProtocol* mProtocol; - AIMUserInfoDialog* m_infoDialog; - TQString mUserProfile; - bool m_haveAwayMessage; - bool m_mobile; // Is this user mobile (i.e. do they have message forwarding on, or mobile AIM) - TQDateTime m_lastAutoresponseTime; - - TDEAction* m_warnUserAction; - TDEToggleAction *m_actionVisibleTo; - TDEToggleAction *m_actionInvisibleTo; -}; -#endif -//kate: tab-width 4; indent-mode csands; diff --git a/kopete/protocols/oscar/aim/aimjoinchat.cpp b/kopete/protocols/oscar/aim/aimjoinchat.cpp deleted file mode 100644 index bc4a3edf..00000000 --- a/kopete/protocols/oscar/aim/aimjoinchat.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// aimjoinchat.cpp - -// Copyright (C) 2005 Matt Rogers - -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. - -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -// 02110-1301 USA - -#include "aimjoinchat.h" - -#include -#include -#include - -#include "aimjoinchatbase.h" -#include "aimaccount.h" - -AIMJoinChatUI::AIMJoinChatUI( AIMAccount* account, bool modal, - TQWidget* parent, const char* name ) - : KDialogBase( parent, name, modal, i18n( "Join AIM Chat Room" ), - Cancel | User1, User1, true, i18n( "Join" ) ) -{ - - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Account " << account->accountId() - << " joining a chat room" << endl; - - m_account = account; - - m_joinUI = new AIMJoinChatBase( this, "aimjoinchatbase" ); - - setMainWidget( m_joinUI ); - - TQObject::connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( joinChat() ) ); - TQObject::connect( this, TQT_SIGNAL( cancelClicked() ), this, TQT_SLOT( closeClicked() ) ); -} - -AIMJoinChatUI::~AIMJoinChatUI() -{ - m_exchanges.clear(); -} - -void AIMJoinChatUI::setExchangeList( const TQValueList& list ) -{ - m_exchanges = list; - TQStringList exchangeList; - TQValueList::const_iterator it = list.begin(); - while ( it != list.end() ) - { - exchangeList.append( TQString::number( ( *it ) ) ); - ++it; - } - - - m_joinUI->exchange->insertStringList( exchangeList ); -} - -void AIMJoinChatUI::joinChat() -{ - m_roomName = m_joinUI->roomName->text(); - int item = m_joinUI->exchange->currentItem(); - m_exchange = m_joinUI->exchange->text( item ); - - emit closing( TQDialog::Accepted ); -} - -void AIMJoinChatUI::closeClicked() -{ - //hmm, do nothing? - emit closing( TQDialog::Rejected ); -} - -TQString AIMJoinChatUI::roomName() const -{ - return m_roomName; -} - -TQString AIMJoinChatUI::exchange() const -{ - return m_exchange; -} - -#include "aimjoinchat.moc" -//kate: space-indent on; indent-width 4; diff --git a/kopete/protocols/oscar/aim/aimjoinchat.h b/kopete/protocols/oscar/aim/aimjoinchat.h deleted file mode 100644 index 828aab35..00000000 --- a/kopete/protocols/oscar/aim/aimjoinchat.h +++ /dev/null @@ -1,63 +0,0 @@ -// aimjoinchat.h - -// Copyright (C) 2005 Matt Rogers - -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. - -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -// 02110-1301 USA - -#ifndef AIMJOINCHAT_H -#define AIMJOINCHAT_H - -#include - -#include "oscartypes.h" - -class AIMAccount; -class AIMJoinChatBase; - -class AIMJoinChatUI : public KDialogBase -{ -Q_OBJECT - -public: - AIMJoinChatUI( AIMAccount*, bool modal, TQWidget* parent = 0, - const char* name = 0 ); - ~AIMJoinChatUI(); - - void setExchangeList( const TQValueList& ); - TQValueList exchangeList() const; - - TQString roomName() const; - TQString exchange() const; - - -protected slots: - void joinChat(); - void closeClicked(); - -signals: - void closing( int ); - -private: - AIMJoinChatBase* m_joinUI; - AIMAccount* m_account; - TQValueList m_exchanges; - TQString m_roomName; - TQString m_exchange; - -}; - -#endif -//kate: space-indent on; indent-width 4; diff --git a/kopete/protocols/oscar/aim/aimprotocol.cpp b/kopete/protocols/oscar/aim/aimprotocol.cpp deleted file mode 100644 index f71e1848..00000000 --- a/kopete/protocols/oscar/aim/aimprotocol.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/* - oscarprotocol.cpp - Oscar Protocol Plugin - - Copyright (c) 2002 by Tom Linsky - - Kopete (c) 2002-2003 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* - */ - -#include -#include -#include -#include - -#include "aimprotocol.h" -#include "aimaccount.h" -#include "aimcontact.h" -#include "aimaddcontactpage.h" -#include "aimeditaccountwidget.h" - -#include "accountselector.h" -#include "kopeteaccountmanager.h" -#include "kopeteonlinestatusmanager.h" -#include "kopeteglobal.h" -#include "kopeteuiglobal.h" -#include "kopetemetacontact.h" - -#include -#include -#include - -typedef KGenericFactory AIMProtocolFactory; - -K_EXPORT_COMPONENT_FACTORY( kopete_aim, AIMProtocolFactory( "kopete_aim" ) ) - -AIMProtocol* AIMProtocol::protocolStatic_ = 0L; - - -AIMProtocolHandler::AIMProtocolHandler() : Kopete::MimeTypeHandler(false) -{ - registerAsProtocolHandler(TQString::fromLatin1("aim")); -} - -void AIMProtocolHandler::handleURL(const KURL &url) const -{ -/** - * Send a Message ================================================= - * aim:goim - * aim:goim?screenname=screen+name - * aim:goim?screenname=screen+name&message=message - * Add Buddy ====================================================== - * aim:addbuddy - * aim:addbuddy?screenname=screen+name - * Buddy Icon ===================================================== - * aim:buddyicon - * aim:buddyicon?src=image_source - * aim:buddyicon?screename=screen+name - * aim:buddyicon?src=image_source&screename=screen+name - * Get and Send Files ============================================= - * aim:getfile?screename=(sn) - * aim:sendfile?screenname=(sn) - * Register User ================================================== - * aim:RegisterUser?ScreenName=sn&Password=pw&SignonNow=False - * Away Message =================================================== - * aim:goaway?message=brb+or+something - * Chat Rooms ===================================================== - * aim:GoChat?RoomName=room+name&Exchange=number - **/ - - AIMProtocol *proto = AIMProtocol::protocol(); - kdDebug(14152) << k_funcinfo << "URL url : '" << url.url() << "'" << endl; - kdDebug(14152) << k_funcinfo << "URL path : '" << url.path() << "'" << endl; - TQString command = url.path(); - TQString realCommand, firstParam, secondParam; - bool needContactAddition = false; - if ( command.find( "goim", 0, false ) != -1 ) - { - realCommand = "goim"; - kdDebug(14152) << k_funcinfo << "Handling send IM request" << endl; - command.remove(0,4); - if ( command.find( "?screenname=", 0, false ) == -1 ) - { - kdWarning(14152) << k_funcinfo << "Unhandled AIM URI:" << url.url() << endl; - return; - } - command.remove( 0, 12 ); - int andSign = command.find( "&" ); - if ( andSign > 0 ) - command = command.left( andSign ); - - firstParam = command; - firstParam.replace( "+", " " ); - needContactAddition = true; - } - else - if ( command.find( "addbuddy", 0, false ) != -1 ) - { - realCommand = "addbuddy"; - kdDebug(14152) << k_funcinfo << "Handling AIM add buddy request" << endl; - command.remove( 0, 8 ); - if ( command.find( "?screenname=", 0, false ) == -1 ) - { - kdWarning(14152) << k_funcinfo << "Unhandled AIM URI:" << url.url() << endl; - return; - } - - command.remove(0, 12); - int andSign = command.find("&"); - if ( andSign > 0 ) - command = command.left(andSign); - command.replace("+", " "); - - firstParam = command; - needContactAddition = true; - } - else - if ( command.find( "gochat", 0, false ) != -1 ) - { - realCommand = "gochat"; - kdDebug(14152) << k_funcinfo << "Handling AIM chat room request" << endl; - command.remove( 0, 6 ); - - if ( command.find( "?RoomName=", 0, false ) == -1 ) - { - kdWarning(14152) << "Unhandled AIM URI: " << url.url() << endl; - return; - } - - command.remove( 0, 10 ); - - int andSign = command.find("&"); - if (andSign > 0) // strip off anything else for now - { - firstParam = command.left(andSign); - } - command.remove( 0, andSign ); - kdDebug(14152) << "command is now: " << command << endl; - command.remove( 0, 10 ); //remove "&Exchange=" - secondParam = command; - kdDebug(14152) << k_funcinfo << firstParam << " " << secondParam << endl; - firstParam.replace("+", " "); - } - - Kopete::Account *account = 0; - TQDict accounts = Kopete::AccountManager::self()->accounts(proto); - - if (accounts.count() == 1) - { - TQDictIterator it(accounts); - account = it.current(); - - } - else - { - KDialogBase *chooser = new KDialogBase(0, "chooser", true, - i18n("Choose Account"), KDialogBase::Ok|KDialogBase::Cancel, - KDialogBase::Ok, false); - AccountSelector *accSelector = new AccountSelector(proto, chooser, "accSelector"); - chooser->setMainWidget(accSelector); - - int ret = chooser->exec(); - account = accSelector->selectedItem(); - - delete chooser; - if (ret == TQDialog::Rejected || account == 0) - { - kdDebug(14152) << k_funcinfo << "Cancelled" << endl; - return; - } - } - - Kopete::MetaContact* mc = 0; - if ( needContactAddition || realCommand == "addbuddy" ) - { - if ( !account->isConnected() ) - { - kdDebug(14152) << k_funcinfo << "Can't add contact, we are offline!" << endl; - KMessageBox::sorry( Kopete::UI::Global::mainWidget(), i18n("You need to be connected to be able to add contacts."), - i18n("AIM") ); - return; - } - - if (KMessageBox::questionYesNo(Kopete::UI::Global::mainWidget(), - i18n("Do you want to add '%1' to your contact list?").arg(command), - TQString(), i18n("Add"), i18n("Do Not Add")) - != KMessageBox::Yes) - { - kdDebug(14152) << k_funcinfo << "Cancelled" << endl; - return; - } - - kdDebug(14152) << k_funcinfo << - "Adding Contact; screenname = " << firstParam << endl; - mc = account->addContact(firstParam, command, 0L, Kopete::Account::Temporary); - } - - if ( realCommand == "gochat" ) - { - AIMAccount* aimAccount = dynamic_cast( account ); - if ( aimAccount && aimAccount->isConnected() ) - { - aimAccount->engine()->joinChatRoom( firstParam, secondParam.toInt() ); - } - else - KMessageBox::sorry( Kopete::UI::Global::mainWidget(), - i18n( "Unable to connect to the chat room %1 because the account" - " for %2 is not connected." ).arg( firstParam ).arg( aimAccount->accountId() ), - TQString() ); - - } - - if ( mc && realCommand == "goim" ) - { - mc->execute(); - } - -} - - - - -AIMProtocol::AIMProtocol(TQObject *parent, const char *name, const TQStringList &) - : Kopete::Protocol( AIMProtocolFactory::instance(), parent, name ), - statusOnline( Kopete::OnlineStatus::Online, 2, this, 0, TQString(), i18n("Online"), i18n("Online"), Kopete::OnlineStatusManager::Online ), - statusOffline( Kopete::OnlineStatus::Offline, 2, this, 10, TQString(), i18n("Offline"), i18n("Offline"), Kopete::OnlineStatusManager::Offline ), - statusAway( Kopete::OnlineStatus::Away, 2, this, 20, "contact_away_overlay", i18n("Away"), i18n("Away"), Kopete::OnlineStatusManager::Away, - Kopete::OnlineStatusManager::HasAwayMessage ), - statusWirelessOnline( Kopete::OnlineStatus::Online, 1, this, 30, "contact_phone_overlay", i18n("Mobile"), i18n("Mobile"), - Kopete::OnlineStatusManager::Online, Kopete::OnlineStatusManager::HideFromMenu ), - statusWirelessAway( Kopete::OnlineStatus::Away, 1, this, 31, TQStringList::split( " ", "contact_phone_overlay contact_away_overlay"), - i18n("Mobile Away"), i18n("Mobile Away"), Kopete::OnlineStatusManager::Away, Kopete::OnlineStatusManager::HideFromMenu ), - statusConnecting(Kopete::OnlineStatus::Connecting, 99, this, 99, "aim_connecting", i18n("Connecting...")), - awayMessage(Kopete::Global::Properties::self()->awayMessage()), - clientFeatures("clientFeatures", i18n("Client Features"), 0, false), - clientProfile( "clientProfile", i18n( "User Profile"), 0, false, true), - iconHash("iconHash", i18n("Buddy Icon MD5 Hash"), TQString(), true, false, true) -{ - if (protocolStatic_) - kdDebug(14152) << k_funcinfo << "AIM plugin already initialized" << endl; - else - protocolStatic_ = this; - - setCapabilities(0x1FFF); // setting capabilities - FIXME to use proper enum - kdDebug(14152) << k_funcinfo << "capabilities set to 0x1FFF" << endl; - addAddressBookField("messaging/aim", Kopete::Plugin::MakeIndexField); - KImageIO::registerFormats(); -} - -AIMProtocol::~AIMProtocol() -{ - protocolStatic_ =0L; -} - -AIMProtocol *AIMProtocol::protocol(void) -{ - return protocolStatic_; -} - -Kopete::Contact *AIMProtocol::deserializeContact(Kopete::MetaContact *metaContact, - const TQMap &serializedData, - const TQMap &/*addressBookData*/) -{ - - TQString contactId = serializedData["contactId"]; - TQString accountId = serializedData["accountId"]; - TQString displayName = serializedData["displayName"]; - - // Get the account it belongs to - TQDict accounts = Kopete::AccountManager::self()->accounts( this ); - Kopete::Account *account = accounts[accountId]; - - if ( !account ) //no account - return 0; - - uint ssiGid = 0, ssiBid = 0, ssiType = 0xFFFF; - TQString ssiName; - bool ssiWaitingAuth = false; - if ( serializedData.contains( "ssi_type" ) ) - { - ssiName = serializedData["ssi_name"]; - TQString authStatus = serializedData["ssi_waitingAuth"]; - if ( authStatus == "true" ) - ssiWaitingAuth = true; - ssiGid = serializedData["ssi_gid"].toUInt(); - ssiBid = serializedData["ssi_bid"].toUInt(); - ssiType = serializedData["ssi_type"].toUInt(); - } - - Oscar::SSI item( ssiName, ssiGid, ssiBid, ssiType, TQValueList(), 0 ); - item.setWaitingAuth( ssiWaitingAuth ); - - AIMContact *c = new AIMContact( account, contactId, metaContact, TQString(), item ); - return c; -} - -AddContactPage *AIMProtocol::createAddContactWidget(TQWidget *parent, Kopete::Account *account) -{ - return ( new AIMAddContactPage( account->isConnected(), parent ) ); -} - -KopeteEditAccountWidget *AIMProtocol::createEditAccountWidget(Kopete::Account *account, TQWidget *parent) -{ - return ( new AIMEditAccountWidget( this, account, parent ) ); -} - -Kopete::Account *AIMProtocol::createNewAccount(const TQString &accountId) -{ - return ( new AIMAccount( this, accountId ) ); -} - -#include "aimprotocol.moc" -// vim: set noet ts=4 sts=4 sw=4: diff --git a/kopete/protocols/oscar/aim/aimprotocol.h b/kopete/protocols/oscar/aim/aimprotocol.h deleted file mode 100644 index 26d092b6..00000000 --- a/kopete/protocols/oscar/aim/aimprotocol.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - oscarprotocol.h - Oscar Protocol Plugin - - Copyright (c) 2002 by Tom Linsky - Copyright (c) 2005 by Matt Rogers - Kopete (c) 2002 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* - */ - -#ifndef AIMPROTOCOL_H -#define AIMPROTOCOL_H - -#include "kopeteprotocol.h" -#include "kopetecontactproperty.h" -#include "kopetemimetypehandler.h" -#include "kopeteonlinestatus.h" - -#include - -namespace Kopete -{ -class OnlineStatus; -} - -class AIMProtocolHandler : public Kopete::MimeTypeHandler -{ -public: - AIMProtocolHandler(); - void handleURL( const KURL & url ) const; -}; - -class AIMProtocol : public Kopete::Protocol -{ - Q_OBJECT - - -public: - AIMProtocol( TQObject *parent, const char *name, const TQStringList &args ); - virtual ~AIMProtocol(); - /** - * Return the active instance of the protocol - * because it's a singleton, can only be used inside AIM classes, not in oscar lib - */ - static AIMProtocol *protocol(); - - bool canSendOffline() const { return false; } - - virtual Kopete::Contact *deserializeContact( Kopete::MetaContact *metaContact, - const TQMap &serializedData, - const TQMap &addressBookData ); - - AddContactPage*createAddContactWidget( TQWidget *parent, Kopete::Account *account ); - KopeteEditAccountWidget* createEditAccountWidget( Kopete::Account *account, TQWidget *parent ); - Kopete::Account* createNewAccount( const TQString &accountId ); - - /** - * The set of online statuses that AIM contacts can have - */ - const Kopete::OnlineStatus statusOnline; - const Kopete::OnlineStatus statusOffline; - const Kopete::OnlineStatus statusAway; - const Kopete::OnlineStatus statusWirelessOnline; - const Kopete::OnlineStatus statusWirelessAway; - const Kopete::OnlineStatus statusConnecting; - - const Kopete::ContactPropertyTmpl awayMessage; - const Kopete::ContactPropertyTmpl clientFeatures; - const Kopete::ContactPropertyTmpl clientProfile; - const Kopete::ContactPropertyTmpl iconHash; - -private: - /** The active instance of oscarprotocol */ - static AIMProtocol *protocolStatic_; - AIMProtocolHandler protohandler; -}; - -#endif -//kate: tab-width 4; indent-mode csands; diff --git a/kopete/protocols/oscar/aim/aimuserinfo.cpp b/kopete/protocols/oscar/aim/aimuserinfo.cpp deleted file mode 100644 index 0cce3a5c..00000000 --- a/kopete/protocols/oscar/aim/aimuserinfo.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* - oscaruserinfo.cpp - Oscar Protocol Plugin - - Copyright (c) 2002 by Tom Linsky - - Kopete (c) 2002 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* - */ - -#include "aimuserinfo.h" - -#include "aimaccount.h" -#include "aimcontact.h" -#include "aimprotocol.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, bool modal, - TQWidget *parent, const char* name ) - : KDialogBase( parent, name, modal, i18n( "User Information on %1" ) - .arg( c->property( Kopete::Global::Properties::self()->nickName() ).value().toString() ), - Cancel | Ok , Ok, true ) -{ - kdDebug(14200) << k_funcinfo << "for contact '" << c->contactId() << "'" << endl; - - m_contact = c; - mAccount = acc; - - mMainWidget = new AIMUserInfoWidget(this, "aimuserinfowidget"); - setMainWidget(mMainWidget); - - TQObject::connect(this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotSaveClicked())); - TQObject::connect(this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(slotUpdateClicked())); - TQObject::connect(this, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotCloseClicked())); - TQObject::connect(c, TQT_SIGNAL(updatedProfile()), this, TQT_SLOT(slotUpdateProfile())); - - mMainWidget->txtScreenName->setText( c->contactId() ); - - TQString nickName = c->property( Kopete::Global::Properties::self()->nickName() ).value().toString(); - if( nickName.isEmpty() ) - mMainWidget->txtNickName->setText( c->contactId() ); - else - mMainWidget->txtNickName->setText( nickName ); - - if(m_contact == mAccount->myself()) // edit own account profile - { - mMainWidget->lblWarnLevel->hide(); - mMainWidget->txtWarnLevel->hide(); - mMainWidget->lblIdleTime->hide(); - mMainWidget->txtIdleTime->hide(); - mMainWidget->lblOnlineSince->hide(); - mMainWidget->txtOnlineSince->hide(); - mMainWidget->txtAwayMessage->hide(); - mMainWidget->lblAwayMessage->hide(); - - userInfoView=0L; - mMainWidget->userInfoFrame->setFrameStyle(TQFrame::NoFrame | TQFrame::Plain); - TQVBoxLayout *l = new TQVBoxLayout(mMainWidget->userInfoFrame); - userInfoEdit = new KTextEdit(TQString(), TQString(), - mMainWidget->userInfoFrame, "userInfoEdit"); - userInfoEdit->setTextFormat(PlainText); - - AIMMyselfContact* aimmc = dynamic_cast( c ); - if ( aimmc ) - userInfoEdit->setText( aimmc->userProfile() ); - else - userInfoEdit->setText( TQString() ); - - setButtonText(Ok, i18n("&Save Profile")); - showButton(User1, false); - l->addWidget(userInfoEdit); - } - else - { - userInfoEdit=0L; - mMainWidget->userInfoFrame->setFrameStyle(TQFrame::NoFrame | TQFrame::Plain); - TQVBoxLayout *l = new TQVBoxLayout(mMainWidget->userInfoFrame); - userInfoView = new KTextBrowser(mMainWidget->userInfoFrame, "userInfoView"); - userInfoView->setTextFormat(AutoText); - userInfoView->setNotifyClick(true); - TQObject::connect( - userInfoView, TQT_SIGNAL(urlClick(const TQString&)), - this, TQT_SLOT(slotUrlClicked(const TQString&))); - TQObject::connect( - userInfoView, TQT_SIGNAL(mailClick(const TQString&, const TQString&)), - this, TQT_SLOT(slotMailClicked(const TQString&, const TQString&))); - showButton(Cancel, false); - setButtonText(Ok, i18n("&Close")); - setEscapeButton(Ok); - l->addWidget(userInfoView); - - if(m_contact->isOnline()) - { - // Update the user view to indicate that we're requesting the user's profile - userInfoView->setText(i18n("Requesting User Profile, please wait...")); - } - TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateProfile())); - } -} - -AIMUserInfoDialog::~AIMUserInfoDialog() -{ - kdDebug(14200) << k_funcinfo << "Called." << endl; -} - -void AIMUserInfoDialog::slotUpdateClicked() -{ - kdDebug(14200) << k_funcinfo << "Called." << endl; - TQString newNick = mMainWidget->txtNickName->text(); - TQString currentNick = m_contact->property( Kopete::Global::Properties::self()->nickName() ).value().toString(); - if ( !newNick.isEmpty() && ( newNick != currentNick ) ) - { - //m_contact->rename(newNick); - //emit updateNickname(newNick); - setCaption(i18n("User Information on %1").arg(newNick)); - } - -} - -void AIMUserInfoDialog::slotSaveClicked() -{ - kdDebug(14200) << k_funcinfo << "Called." << endl; - - if (userInfoEdit) - { // editable mode, set profile - TQString newNick = mMainWidget->txtNickName->text(); - TQString currentNick = m_contact->property( Kopete::Global::Properties::self()->nickName() ).value().toString(); - if(!newNick.isEmpty() && ( newNick != currentNick ) ) - { - //m_contact->rename(newNick); - //emit updateNickname(newNick); - setCaption(i18n("User Information on %1").arg(newNick)); - } - - mAccount->setUserProfile(userInfoEdit->text()); - } - - emit closing(); -} - -void AIMUserInfoDialog::slotCloseClicked() -{ - kdDebug(14200) << k_funcinfo << "Called." << endl; - emit closing(); -} - -void AIMUserInfoDialog::slotUpdateProfile() -{ - kdDebug(14152) << k_funcinfo << "Got User Profile." << endl; - AIMProtocol* p = static_cast( mAccount->protocol() ); - TQString awayMessage = m_contact->property( p->awayMessage ).value().toString(); - mMainWidget->txtAwayMessage->setText( awayMessage ); - - if ( awayMessage.isNull() ) - { - mMainWidget->txtAwayMessage->hide(); - mMainWidget->lblAwayMessage->hide(); - } - else - { - mMainWidget->txtAwayMessage->show(); - mMainWidget->lblAwayMessage->show(); - } - - TQString onlineSince = m_contact->property("onlineSince").value().toString(); - //TQString onlineSince = m_details.onlineSinceTime().toString(); - mMainWidget->txtOnlineSince->setText( onlineSince ); - - AIMContact* c = static_cast( m_contact ); - mMainWidget->txtIdleTime->setText(c->formattedIdleTime()); - mMainWidget->txtWarnLevel->setText(TQString::number(c->warningLevel())); - - TQString contactProfile = m_contact->property( p->clientProfile ).value().toString(); - if ( contactProfile.isNull() ) - { - contactProfile = - i18n("No user information provided"); - } - - if(userInfoEdit) - { - userInfoEdit->setText(contactProfile); - } - else if(userInfoView) - { - userInfoView->setText(contactProfile); - } - -} - -void AIMUserInfoDialog::slotUrlClicked(const TQString &url) -{ - new KRun(KURL(url)); -} - -void AIMUserInfoDialog::slotMailClicked(const TQString&, const TQString &address) -{ - new KRun(KURL(address)); -} - -#include "aimuserinfo.moc" - -//kate: indent-mode csands; tab-width 4; space-indent off; replace-tabs off; diff --git a/kopete/protocols/oscar/aim/aimuserinfo.h b/kopete/protocols/oscar/aim/aimuserinfo.h deleted file mode 100644 index d9e77fc5..00000000 --- a/kopete/protocols/oscar/aim/aimuserinfo.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - oscaruserinfo.h - Oscar Protocol Plugin - - Copyright (c) 2002 by Tom Linsky - - Kopete (c) 2002 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* -*/ - -#ifndef AIMUSERINFO_H -#define AIMUSERINFO_H - -#include -#include "aiminfobase.h" - -namespace Kopete { class Contact; } -class KTextEdit; -class OscarAccount; -class AIMMyselfContact; -class AIMAccount; - -class AIMUserInfoDialog : public KDialogBase -{ - Q_OBJECT - - public: - AIMUserInfoDialog(Kopete::Contact *c, AIMAccount *acc, bool modal, - TQWidget *parent, const char* name); - ~AIMUserInfoDialog(); - - private: - AIMAccount *mAccount; - Kopete::Contact* m_contact; - AIMUserInfoWidget *mMainWidget; - KTextBrowser *userInfoView; - KTextEdit *userInfoEdit; - - private slots: - void slotSaveClicked(); - void slotCloseClicked(); - void slotUpdateClicked(); - void slotUpdateProfile(); - void slotUrlClicked(const TQString&); - void slotMailClicked(const TQString&, const TQString&); - - signals: -// void updateNickname(const TQString &); - void closing(); -}; - -#endif - diff --git a/kopete/protocols/oscar/aim/kopete_aim.desktop b/kopete/protocols/oscar/aim/kopete_aim.desktop deleted file mode 100644 index cf590551..00000000 --- a/kopete/protocols/oscar/aim/kopete_aim.desktop +++ /dev/null @@ -1,77 +0,0 @@ -[Desktop Entry] -Type=Service -X-Kopete-Version=1000900 -Icon=aim_protocol -X-TDE-ServiceTypes=Kopete/Protocol -X-TDE-Library=kopete_aim -X-Kopete-Messaging-Protocol=messaging/aim -X-TDE-PluginInfo-Author=Kopete Developers -X-TDE-PluginInfo-Email=kopete-devel@kde.org -X-TDE-PluginInfo-Name=kopete_aim -X-TDE-PluginInfo-Version=0.10.0 -X-TDE-PluginInfo-Website=http://kopete.kde.org -X-TDE-PluginInfo-Category=Protocols -X-TDE-PluginInfo-Depends= -X-TDE-PluginInfo-License=GPL -X-TDE-PluginInfo-EnabledByDefault=false -Name=AIM -Name[bn]=এ-আই-এম -Name[hi]=एआरईएम -Name[ne]=एआईएम -Comment=Protocol to connect to AIM -Comment[ar]=البرتوكول سيتصل بـ AIM -Comment[be]=Пратакол AIM -Comment[bg]=Протокол за връзка с AIM -Comment[bn]=এ-আই-এমতে সংযোগ করতে প্রোটোকল -Comment[br]=Komenad kevreañ ouzh AIM -Comment[bs]=AIM protokol -Comment[ca]=Protocol per a connectar-se a AIM -Comment[cs]=Protokol k připojení k AIM -Comment[cy]=Protocol i gysylltu ag AIM -Comment[da]=Protokol til at forbinde til AIM -Comment[de]=Protokoll zur Verbindung mit dem AIM -Comment[el]=Πρωτόκολλο για σύνδεση στο AIM -Comment[es]=Protocolo para conectar a AIM -Comment[et]=Protokoll ühendumiseks AIM-iga -Comment[eu]=AIM-era konektatzeko protokoloa -Comment[fa]=قرارداد برای اتصال به AIM -Comment[fi]=Yhteyskäytäntö AIM-verkkoon kytkeytymiseen -Comment[fr]=Protocole pour se connecter sur AIM -Comment[ga]=Prótacal chun ceangal le AIM -Comment[gl]=Protocolo para se conectar ó AIM -Comment[he]=פרוטוקול התחברות ל- AIM -Comment[hi]=से जुड़ने का प्रोटोकॉल -Comment[hr]=Protokol za povezivanje na AIM -Comment[hu]=Protokoll az AIM használatához -Comment[is]=Samskiptamáti til að tengjast AIM -Comment[it]=Protocollo per connessione a AIM -Comment[ja]=AIM に接続するプロトコル -Comment[ka]=AIM დაკავშირების ოქმი -Comment[kk]=AIM-ге қосылу протоколы -Comment[km]=ពិធីការ​ភ្ជាប់​ទៅ AIM -Comment[lt]=Protokolas prisijungimui prie AIM -Comment[mk]=Протокол за поврзување на AIM -Comment[nb]=Protokoll for å koble til AIM -Comment[nds]=Protokoll för't Tokoppeln na AIM -Comment[ne]=एआईएम मा जडान गर्नुपर्ने प्रोटोकल -Comment[nl]=Protocol voor AOL Instant Messenger -Comment[nn]=Protokoll for å kopla til AIM -Comment[pl]=Protokół połączenia z serwerem AIM -Comment[pt]=Um protocolo para se ligar ao AIM -Comment[pt_BR]=Protocolo de conexão ao AIM -Comment[ro]=Protocol de conectare la AIM -Comment[ru]=Протокол для подключения к AIM -Comment[sk]=Protokol pre pripojenie k AIM -Comment[sl]=Protokol za povezavo na AIM -Comment[sr]=Протокол за повезивање на AIM -Comment[sr@Latn]=Protokol za povezivanje na AIM -Comment[sv]=Protokoll för att ansluta till AIM -Comment[ta]=IRC உடன் இணைக்க விதிமுறை -Comment[tg]=Қарордоди пайвастшавӣ ба AIM -Comment[tr]=AIM'e bağlantı iletişim kuralı -Comment[uk]=Протокол для з'єднання з AIM -Comment[uz]=AIM bilan aloqa oʻrnatish uchun protokol -Comment[uz@cyrillic]=AIM билан алоқа ўрнатиш учун протокол -Comment[zh_CN]=连接到 AIM 协议 -Comment[zh_HK]=用來連接至 AIM 的通訊協定 -Comment[zh_TW]=連線到 AIM 的協定 diff --git a/kopete/protocols/oscar/aim/ui/CMakeLists.txt b/kopete/protocols/oscar/aim/ui/CMakeLists.txt deleted file mode 100644 index 8f5ff329..00000000 --- a/kopete/protocols/oscar/aim/ui/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/../.. - ${CMAKE_CURRENT_SOURCE_DIR}/../../liboscar - ${CMAKE_BINARY_DIR}/kopete/libkopete/ui - ${CMAKE_SOURCE_DIR}/kopete/libkopete - ${CMAKE_SOURCE_DIR}/kopete/libkopete/ui - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - - -##### kopeteaimui (static) ###################### - -tde_add_library( kopeteaimui STATIC_PIC AUTOMOC - SOURCES - aimaddcontactui.ui aimeditaccountui.ui aiminfobase.ui - aimjoinchatbase.ui aimaddcontactpage.cpp aimeditaccountwidget.cpp -) diff --git a/kopete/protocols/oscar/aim/ui/Makefile.am b/kopete/protocols/oscar/aim/ui/Makefile.am deleted file mode 100644 index aa690449..00000000 --- a/kopete/protocols/oscar/aim/ui/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -METASOURCES = AUTO -AM_CPPFLAGS = $(KOPETE_INCLUDES) \ - -I$(srcdir)/.. \ - -I$(srcdir)/../.. \ - -I$(srcdir)/../../liboscar \ - $(all_includes) - -noinst_LTLIBRARIES = libkopeteaimui.la - -libkopeteaimui_la_SOURCES = aimaddcontactui.ui aimeditaccountui.ui \ - aiminfobase.ui aimjoinchatbase.ui aimaddcontactpage.cpp aimeditaccountwidget.cpp - -libkopeteaimui_la_LIBADD = $(top_builddir)/kopete/libkopete/libkopete.la - - diff --git a/kopete/protocols/oscar/aim/ui/aimaddcontactpage.cpp b/kopete/protocols/oscar/aim/ui/aimaddcontactpage.cpp deleted file mode 100644 index c6612027..00000000 --- a/kopete/protocols/oscar/aim/ui/aimaddcontactpage.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - description - ------------------- - begin : - copyright : (C) 2002 by nbetcher - email : nbetcher@usinternet.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "aimaddcontactui.h" -#include "aimaddcontactpage.h" - -#include "kopeteaccount.h" - -#include -#include -#include -#include - -AIMAddContactPage::AIMAddContactPage(bool connected, TQWidget *parent, - const char *name ) - : AddContactPage(parent,name) -{ - m_gui = 0; - (new TQVBoxLayout(this))->setAutoAdd(true); - - if(connected) - { - m_gui = new aimAddContactUI(this); - canadd = true; - } - else - { - noaddMsg1 = new TQLabel(i18n("You need to be connected to be able to add contacts."), this); - noaddMsg2 = new TQLabel(i18n("Connect to the AIM network and try again."), this); - canadd = false; - } -} - - -AIMAddContactPage::~AIMAddContactPage() -{ -} - -bool AIMAddContactPage::validateData() -{ - if ( !canadd ) - return false; - - if ( !m_gui ) - return false; - - TQString sn = m_gui->addSN->text(); - if ( sn.isEmpty() ) - { - KMessageBox::sorry ( this, - i18n("You must enter a valid screen name."), - i18n("No Screen Name") ); - return false; - } - return true; -} - -bool AIMAddContactPage::apply(Kopete::Account *account, - Kopete::MetaContact *metaContact) -{ - if(validateData()) - { // If everything is ok - return account->addContact( m_gui->addSN->text(), metaContact, Kopete::Account::ChangeKABC ); - } - return false; -} -//kate: tab-width 4; indent-mode csands; - -#include "aimaddcontactpage.moc" diff --git a/kopete/protocols/oscar/aim/ui/aimaddcontactpage.h b/kopete/protocols/oscar/aim/ui/aimaddcontactpage.h deleted file mode 100644 index c3bcaa36..00000000 --- a/kopete/protocols/oscar/aim/ui/aimaddcontactpage.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef AIMADDCONTACTPAGE_H -#define AIMADDCONTACTPAGE_H - -#include -#include -#include "addcontactpage.h" - -class aimAddContactUI; -class AIMAccount; -namespace Kopete -{ -class Account; -class MetaContact; -} - -class AIMAddContactPage : public AddContactPage -{ -Q_OBJECT - - -public: - AIMAddContactPage(bool connected, TQWidget *parent=0, - const char *name=0); - ~AIMAddContactPage(); - - /** Validates the data entered */ - virtual bool validateData(); - /** Applies the addition to the account */ - virtual bool apply( Kopete::Account *account, Kopete::MetaContact *); - -protected: - /** The actual GUI */ - aimAddContactUI *m_gui; - TQLabel *noaddMsg1; - TQLabel *noaddMsg2; - bool canadd; -}; -#endif - -//kate: tab-width 4; indent-mode csands; - diff --git a/kopete/protocols/oscar/aim/ui/aimaddcontactui.ui b/kopete/protocols/oscar/aim/ui/aimaddcontactui.ui deleted file mode 100644 index 663d2fc5..00000000 --- a/kopete/protocols/oscar/aim/ui/aimaddcontactui.ui +++ /dev/null @@ -1,64 +0,0 @@ - -aimAddContactUI - - - aimAddContactUI - - - - 0 - 0 - 455 - 131 - - - - - unnamed - - - 0 - - - - GroupBox1 - - - Contact Information - - - - - - - - unnamed - - - 11 - - - 6 - - - - addSN - - - - - TextLabel1 - - - AIM screen name: - - - - - - - - addSN - - - diff --git a/kopete/protocols/oscar/aim/ui/aimeditaccountui.ui b/kopete/protocols/oscar/aim/ui/aimeditaccountui.ui deleted file mode 100644 index c2ec9844..00000000 --- a/kopete/protocols/oscar/aim/ui/aimeditaccountui.ui +++ /dev/null @@ -1,540 +0,0 @@ - -aimEditAccountUI - - - aimEditAccountUI - - - - 0 - 0 - 560 - 583 - - - - - 5 - 5 - 0 - 0 - - - - Account Preferences - AIM - - - - unnamed - - - 0 - - - 0 - - - - labelStatusMessage - - - - - - AlignCenter - - - - - tabWidget6 - - - - tab - - - &Basic Setup - - - - unnamed - - - - groupBox72 - - - Account Information - - - - unnamed - - - - layout4 - - - - unnamed - - - - lblAccountId - - - AIM &screen name: - - - edtAccountId - - - The screen name of your AIM account. - - - The screen name of your AIM account. This should be in the form of an alphanumeric string (spaces allowed, not case sensitive). - - - - - edtAccountId - - - The screen name of your AIM account. - - - The screen name of your AIM account. This should be in the form of an alphanumeric string (spaces allowed, not case sensitive). - - - - - - - mPasswordWidget - - - - - mGlobalIdentity - - - Exclu&de from Global Identity - - - - - mAutoLogon - - - E&xclude from connect all - - - If you check that case, the account will not be connected when you press the "Connect All" button, or at startup even if you selected to automatically connect at startup - - - - - - - groupBox5 - - - - 3 - 1 - 0 - 0 - - - - Registration - - - - unnamed - - - - textLabel6 - - - - 3 - 1 - 0 - 0 - - - - - 0 - 0 - - - - To connect to the AOL Instant Messaging network, you will need to use a screen name from AIM, AOL, or .Mac.<br><br>If you do not currently have an AIM screen name, please click the button to create one. - - - WordBreak|AlignVCenter - - - - - buttonRegister - - - Re&gister New Account - - - - - - - spacer7 - - - Vertical - - - Expanding - - - - 20 - 90 - - - - - - - - tab - - - Accou&nt Preferences - - - - unnamed - - - - groupBox73 - - - Connection Preferences - - - - unnamed - - - - optionOverrideServer - - - &Override default server information - - - false - - - - - layout58 - - - - unnamed - - - - lblServer - - - false - - - Ser&ver: - - - edtServerAddress - - - The IP address or hostmask of the AIM server you wish to connect to. - - - The IP address or hostmask of the AIM server you wish to connect to. Normally you will want the default (login.oscar.aol.com). - - - - - edtServerAddress - - - false - - - login.oscar.aol.com - - - The IP address or hostmask of the AIM server you wish to connect to. - - - The IP address or hostmask of the AIM server you wish to connect to. Normally you will want the default (login.oscar.aol.com). - - - - - lblPort - - - false - - - Po&rt: - - - sbxServerPort - - - The port on the AIM server that you would like to connect to. - - - The port on the AIM server that you would like to connect to. Normally this is 5190. - - - - - sbxServerPort - - - false - - - 65534 - - - 1 - - - 5190 - - - The port on the AIM server that you would like to connect to. - - - The port on the AIM server that you would like to connect to. Normally this is 5190. - - - - - - - - - spacer21 - - - Vertical - - - Expanding - - - - 20 - 200 - - - - - - encodingCombo - - - false - - - - - textLabel1 - - - false - - - Default to the following &encoding for messages: - - - encodingCombo - - - - - - - tab - - - Pri&vacy - - - - unnamed - - - - buttonGroup1 - - - Visibility settings - - - - unnamed - - - - rbAllowPerimtList - - - Allow only from visible list - - - - - rbBlockAll - - - Block all users - - - - - rbBlockAIM - - - Block AIM users - - - - - rbBlockDenyList - - - Block only from invisible list - - - - - rbAllowAll - - - Allow all users - - - - - rbAllowMyContacts - - - Allow only contact list's users - - - - - - - spacer3 - - - Vertical - - - Expanding - - - - 31 - 225 - - - - - - - - - - - Kopete::UI::PasswordWidget -
kopetepasswordwidget.h
- - 50 - 50 - - 0 - - 1 - 0 - 0 - 0 - - image0 - changed() -
-
- - - 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082 - - - - - optionOverrideServer - toggled(bool) - lblServer - setEnabled(bool) - - - optionOverrideServer - toggled(bool) - lblPort - setEnabled(bool) - - - optionOverrideServer - toggled(bool) - edtServerAddress - setEnabled(bool) - - - optionOverrideServer - toggled(bool) - sbxServerPort - setEnabled(bool) - - - - tabWidget6 - edtAccountId - mAutoLogon - buttonRegister - optionOverrideServer - edtServerAddress - sbxServerPort - encodingCombo - rbAllowAll - rbAllowMyContacts - rbAllowPerimtList - rbBlockAll - rbBlockAIM - rbBlockDenyList - - - - kopetepasswordwidget.h - -
diff --git a/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp b/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp deleted file mode 100644 index e3c1f62b..00000000 --- a/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "aimeditaccountwidget.h" -#include "aimeditaccountui.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "kopetepassword.h" -#include "kopetepasswordwidget.h" - -#include "aimprotocol.h" -#include "aimaccount.h" - -AIMEditAccountWidget::AIMEditAccountWidget( AIMProtocol *protocol, - Kopete::Account *account, TQWidget *parent, const char *name ) - : TQWidget( parent, name ), KopeteEditAccountWidget( account ) -{ - //kdDebug(14152) << k_funcinfo << "Called." << endl; - - mAccount = dynamic_cast( account ); - mProtocol = protocol; - - // create the gui (generated from a .ui file) - ( new TQVBoxLayout( this ) )->setAutoAdd( true ); - mGui = new aimEditAccountUI( this, "AIMEditAccountWidget::mGui" ); - - // Read in the settings from the account if it exists - if ( mAccount ) - { - mGui->mPasswordWidget->load( &mAccount->password() ); - mGui->edtAccountId->setText( account->accountId() ); - //Remove me after we can change Account IDs (Matt) - mGui->edtAccountId->setDisabled( true ); - mGui->mAutoLogon->setChecked( account->excludeConnect() ); - TQString serverEntry = account->configGroup()->readEntry( "Server", "login.oscar.aol.com" ); - int portEntry = account->configGroup()->readNumEntry( "Port", 5190 ); - if ( serverEntry != "login.oscar.aol.com" || portEntry != 5190 ) - mGui->optionOverrideServer->setChecked( true ); - else - mGui->optionOverrideServer->setChecked( false ); - - mGui->edtServerAddress->setText( serverEntry ); - mGui->sbxServerPort->setValue( portEntry ); - - using namespace AIM::PrivacySettings; - - int privacySetting = mAccount->configGroup()->readNumEntry( "PrivacySetting", AllowAll ); - switch( privacySetting ) - { - case AllowAll: - mGui->rbAllowAll->setChecked( true ); - break; - case AllowMyContacts: - mGui->rbAllowMyContacts->setChecked( true ); - break; - case AllowPremitList: - mGui->rbAllowPerimtList->setChecked( true ); - break; - case BlockAll: - mGui->rbBlockAll->setChecked( true ); - break; - case BlockAIM: - mGui->rbBlockAIM->setChecked( true ); - break; - case BlockDenyList: - mGui->rbBlockDenyList->setChecked( true ); - break; - default: - mGui->rbAllowAll->setChecked( true ); - } - - // Global Identity - mGui->mGlobalIdentity->setChecked( account->configGroup()->readBoolEntry("ExcludeGlobalIdentity", false) ); - } - TQObject::connect( mGui->buttonRegister, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotOpenRegister() ) ); - - /* Set tab order to password custom widget correctly */ - TQWidget::setTabOrder( mGui->edtAccountId, mGui->mPasswordWidget->mRemembered ); - TQWidget::setTabOrder( mGui->mPasswordWidget->mRemembered, mGui->mPasswordWidget->mPassword ); - TQWidget::setTabOrder( mGui->mPasswordWidget->mPassword, mGui->mAutoLogon ); -} - -AIMEditAccountWidget::~AIMEditAccountWidget() -{} - -Kopete::Account *AIMEditAccountWidget::apply() -{ - kdDebug( 14152 ) << k_funcinfo << "Called." << endl; - - // If this is a new account, create it - if ( !mAccount ) - { - kdDebug( 14152 ) << k_funcinfo << "creating a new account" << endl; - TQString newId = mGui->edtAccountId->text(); - mAccount = new AIMAccount( mProtocol, newId ); - } - - mGui->mPasswordWidget->save( &mAccount->password() ); - - mAccount->setExcludeConnect( mGui->mAutoLogon->isChecked() ); // save the autologon choice - if ( mGui->optionOverrideServer->isChecked() ) - { - static_cast( mAccount )->setServerAddress( mGui->edtServerAddress->text() ); - static_cast( mAccount )->setServerPort( mGui->sbxServerPort->value() ); - } - else - { - static_cast( mAccount )->setServerAddress( "login.oscar.aol.com" ); - static_cast( mAccount )->setServerPort( 5190 ); - } - - using namespace AIM::PrivacySettings; - int privacySetting = AllowAll; - - if ( mGui->rbAllowAll->isChecked() ) - privacySetting = AllowAll; - else if ( mGui->rbAllowMyContacts->isChecked() ) - privacySetting = AllowMyContacts; - else if ( mGui->rbAllowPerimtList->isChecked() ) - privacySetting = AllowPremitList; - else if ( mGui->rbBlockAll->isChecked() ) - privacySetting = BlockAll; - else if ( mGui->rbBlockAIM->isChecked() ) - privacySetting = BlockAIM; - else if ( mGui->rbBlockDenyList->isChecked() ) - privacySetting = BlockDenyList; - - mAccount->configGroup()->writeEntry( "PrivacySetting", privacySetting ); - mAccount->setPrivacySettings( privacySetting ); - - // Global Identity - mAccount->configGroup()->writeEntry( "ExcludeGlobalIdentity", mGui->mGlobalIdentity->isChecked() ); - return mAccount; -} - -bool AIMEditAccountWidget::validateData() -{ - //kdDebug(14152) << k_funcinfo << "Called." << endl; - - TQString userName = mGui->edtAccountId->text(); - TQString server = mGui->edtServerAddress->text(); - int port = mGui->sbxServerPort->value(); - - if ( userName.length() < 1 ) - return false; - - if ( port < 1 ) - return false; - - if ( server.length() < 1 ) - return false; - - // Seems good to me - //kdDebug(14152) << k_funcinfo << "Account data validated successfully." << endl; - return true; -} - -void AIMEditAccountWidget::slotOpenRegister() -{ - KRun::runURL( "http://my.screenname.aol.com/_cqr/login/login.psp?siteId=snshomepage&mcState=initialized&createSn=1", "text/html" ); -} - -#include "aimeditaccountwidget.moc" -// vim: set noet ts=4 sts=4 sw=4: diff --git a/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.h b/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.h deleted file mode 100644 index 6ccaceb5..00000000 --- a/kopete/protocols/oscar/aim/ui/aimeditaccountwidget.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - AIMeditaccountwidget.h - AIM Account Widget - - Copyright (c) 2003 by Chris TenHarmsel - - Kopete (c) 2003 by the Kopete developers - - ************************************************************************* - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ************************************************************************* -*/ - - -#ifndef AIMEDITACCOUNTWIDGET_H -#define AIMEDITACCOUNTWIDGET_H - -#include -#include "editaccountwidget.h" -/** - * @author Chris TenHarmsel - */ - -namespace Kopete -{ -class Account; -} - -class AIMAccount; -class AIMProtocol; -class aimEditAccountUI; - -class AIMEditAccountWidget : public TQWidget, public KopeteEditAccountWidget -{ -Q_OBJECT - - -public: - AIMEditAccountWidget(AIMProtocol *protocol, Kopete::Account *account, - TQWidget *parent=0, const char *name=0); - virtual ~AIMEditAccountWidget(); - - virtual bool validateData(); - virtual Kopete::Account *apply(); - -private slots: - void slotOpenRegister(); - -protected: - AIMAccount *mAccount; - AIMProtocol *mProtocol; - aimEditAccountUI *mGui; -}; -#endif -//kate: tab-width 4; indent-mode csands; diff --git a/kopete/protocols/oscar/aim/ui/aiminfobase.ui b/kopete/protocols/oscar/aim/ui/aiminfobase.ui deleted file mode 100644 index 188e4aad..00000000 --- a/kopete/protocols/oscar/aim/ui/aiminfobase.ui +++ /dev/null @@ -1,246 +0,0 @@ - -AIMUserInfoWidget - - - AIMUserInfoWidget - - - - 0 - 0 - 360 - 408 - - - - - 360 - 400 - - - - - - - unnamed - - - 0 - - - - layout9 - - - - unnamed - - - - lblNickName - - - - 4 - 4 - 0 - 0 - - - - Nickname: - - - - - txtNickName - - - - 7 - 0 - 0 - 0 - - - - - - lblScreenName - - - - 4 - 4 - 0 - 0 - - - - Screen name: - - - - - txtScreenName - - - true - - - - - - - layout10 - - - - unnamed - - - - lblWarnLevel - - - Warning level: - - - - - txtWarnLevel - - - true - - - - - lblIdleTime - - - Idle minutes: - - - - - txtIdleTime - - - true - - - - - - - layout11 - - - - unnamed - - - - lblOnlineSince - - - Online since: - - - - - txtOnlineSince - - - true - - - - - - - lblAwayMessage - - - - 5 - 1 - 0 - 0 - - - - Away message: - - - AlignTop - - - - - txtAwayMessage - - - - 7 - 5 - 0 - 0 - - - - AutoText - - - - - textLabel1 - - - Profile: - - - - - userInfoFrame - - - - 7 - 7 - 0 - 0 - - - - - 64 - 16 - - - - NoFrame - - - Plain - - - 0 - - - - - - txtNickName - txtScreenName - txtWarnLevel - txtIdleTime - txtOnlineSince - txtAwayMessage - - - - ktextbrowser.h - - diff --git a/kopete/protocols/oscar/aim/ui/aimjoinchatbase.ui b/kopete/protocols/oscar/aim/ui/aimjoinchatbase.ui deleted file mode 100644 index 5b2d084b..00000000 --- a/kopete/protocols/oscar/aim/ui/aimjoinchatbase.ui +++ /dev/null @@ -1,124 +0,0 @@ - -AIMJoinChatBase - - - AIMJoinChatBase - - - - 0 - 0 - 343 - 99 - - - - - unnamed - - - 0 - - - - textLabel3 - - - Please enter the name of the chat room you wish to join. - - - - - spacer4 - - - Vertical - - - Fixed - - - - 20 - 16 - - - - - - spacer3 - - - Horizontal - - - Maximum - - - - 60 - 20 - - - - - - textLabel1 - - - Room &name: - - - roomName - - - - - textLabel2 - - - E&xchange: - - - exchange - - - - - roomName - - - - 3 - 0 - 0 - 0 - - - - - - exchange - - - - - spacer2 - - - Vertical - - - Expanding - - - - 20 - 16 - - - - - - - diff --git a/kopete/protocols/oscar/icons/cr128-app-aim_protocol.png b/kopete/protocols/oscar/icons/cr128-app-aim_protocol.png deleted file mode 100644 index cb718f02..00000000 Binary files a/kopete/protocols/oscar/icons/cr128-app-aim_protocol.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr16-action-aim_away.png b/kopete/protocols/oscar/icons/cr16-action-aim_away.png deleted file mode 100644 index c71e92a6..00000000 Binary files a/kopete/protocols/oscar/icons/cr16-action-aim_away.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr16-action-aim_connecting.mng b/kopete/protocols/oscar/icons/cr16-action-aim_connecting.mng deleted file mode 100644 index 90417a14..00000000 Binary files a/kopete/protocols/oscar/icons/cr16-action-aim_connecting.mng and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr16-action-aim_offline.png b/kopete/protocols/oscar/icons/cr16-action-aim_offline.png deleted file mode 100644 index 3ba42b20..00000000 Binary files a/kopete/protocols/oscar/icons/cr16-action-aim_offline.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr16-action-aim_online.png b/kopete/protocols/oscar/icons/cr16-action-aim_online.png deleted file mode 100644 index 2261523f..00000000 Binary files a/kopete/protocols/oscar/icons/cr16-action-aim_online.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr16-app-aim_protocol.png b/kopete/protocols/oscar/icons/cr16-app-aim_protocol.png deleted file mode 100644 index 9e5a3331..00000000 Binary files a/kopete/protocols/oscar/icons/cr16-app-aim_protocol.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr32-app-aim_protocol.png b/kopete/protocols/oscar/icons/cr32-app-aim_protocol.png deleted file mode 100644 index 01d92d38..00000000 Binary files a/kopete/protocols/oscar/icons/cr32-app-aim_protocol.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr48-app-aim_protocol.png b/kopete/protocols/oscar/icons/cr48-app-aim_protocol.png deleted file mode 100644 index 493f3b6c..00000000 Binary files a/kopete/protocols/oscar/icons/cr48-app-aim_protocol.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/cr64-app-aim_protocol.png b/kopete/protocols/oscar/icons/cr64-app-aim_protocol.png deleted file mode 100644 index 04ed6dc8..00000000 Binary files a/kopete/protocols/oscar/icons/cr64-app-aim_protocol.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/hi16-action-aim_away.png b/kopete/protocols/oscar/icons/hi16-action-aim_away.png deleted file mode 100644 index d1b45d8c..00000000 Binary files a/kopete/protocols/oscar/icons/hi16-action-aim_away.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/hi16-action-aim_connecting.mng b/kopete/protocols/oscar/icons/hi16-action-aim_connecting.mng deleted file mode 100644 index 19767318..00000000 Binary files a/kopete/protocols/oscar/icons/hi16-action-aim_connecting.mng and /dev/null differ diff --git a/kopete/protocols/oscar/icons/hi16-action-aim_offline.png b/kopete/protocols/oscar/icons/hi16-action-aim_offline.png deleted file mode 100644 index 6c64cae1..00000000 Binary files a/kopete/protocols/oscar/icons/hi16-action-aim_offline.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/hi16-action-aim_online.png b/kopete/protocols/oscar/icons/hi16-action-aim_online.png deleted file mode 100644 index 9d9bfdee..00000000 Binary files a/kopete/protocols/oscar/icons/hi16-action-aim_online.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/hi16-app-aim_protocol.png b/kopete/protocols/oscar/icons/hi16-app-aim_protocol.png deleted file mode 100644 index 9d9bfdee..00000000 Binary files a/kopete/protocols/oscar/icons/hi16-app-aim_protocol.png and /dev/null differ diff --git a/kopete/protocols/oscar/icons/hi32-app-aim_protocol.png b/kopete/protocols/oscar/icons/hi32-app-aim_protocol.png deleted file mode 100644 index 596785ec..00000000 Binary files a/kopete/protocols/oscar/icons/hi32-app-aim_protocol.png and /dev/null differ diff --git a/kopete/protocols/oscar/icq/kopete_icq.desktop b/kopete/protocols/oscar/icq/kopete_icq.desktop index 082e4900..5fd121ad 100644 --- a/kopete/protocols/oscar/icq/kopete_icq.desktop +++ b/kopete/protocols/oscar/icq/kopete_icq.desktop @@ -23,7 +23,7 @@ Comment[ar]=البرتوكول سيتصل بـ ICQ Comment[be]=Пратакол ICQ Comment[bg]=Протокол за връзка с ICQ Comment[bn]=আই-সি-কিউতে সংযোগ করতে প্রোটোকল -Comment[br]=Komenad kevreañ ouzh AIM +Comment[br]=Komenad kevreañ ouzh ICQ Comment[bs]=ICQ protokol Comment[ca]=Protocol per a connectar-se a ICQ Comment[cs]=Protokol k připojení k ICQ diff --git a/kopete/protocols/yahoo/libkyahoo/yabentry.cpp b/kopete/protocols/yahoo/libkyahoo/yabentry.cpp index 4b197b28..bcd067c4 100644 --- a/kopete/protocols/yahoo/libkyahoo/yabentry.cpp +++ b/kopete/protocols/yahoo/libkyahoo/yabentry.cpp @@ -56,7 +56,6 @@ void YABEntry::fromTQDomElement( const TQDomElement &e ) additional3 = e.attribute("c3"); additional4 = e.attribute("c4"); notes = e.attribute("cm").replace( " ", "\n" ); - imAIM = e.attribute("ima"); imGoogleTalk = e.attribute("img"); imICQ = e.attribute("imq"); imIRC = e.attribute("imc"); @@ -105,7 +104,6 @@ void YABEntry::fromTQDomDocument( const TQDomDocument &d ) additional3 = d.elementsByTagName("c3").item(0).toElement().text(); additional4 = d.elementsByTagName("c4").item(0).toElement().text(); notes = d.elementsByTagName("cm").item(0).toElement().text().replace( " ", "\n" ); - imAIM = d.elementsByTagName("ima").item(0).toElement().text(); imGoogleTalk = d.elementsByTagName("img").item(0).toElement().text(); imICQ = d.elementsByTagName("imq").item(0).toElement().text(); imIRC = d.elementsByTagName("imc").item(0).toElement().text(); @@ -151,7 +149,6 @@ void YABEntry::fillTQDomElement( TQDomElement &e ) const e.setAttribute( "c3", additional3 ); e.setAttribute( "c4", additional4 ); e.setAttribute( "cm", TQString( notes ).replace( '\n', " " ) ); - e.setAttribute( "ima", imAIM ); e.setAttribute( "img", imGoogleTalk ); e.setAttribute( "imq", imICQ ); e.setAttribute( "imc", imIRC ); diff --git a/kopete/protocols/yahoo/libkyahoo/yabentry.h b/kopete/protocols/yahoo/libkyahoo/yabentry.h index bcb2bce9..f11d446e 100644 --- a/kopete/protocols/yahoo/libkyahoo/yabentry.h +++ b/kopete/protocols/yahoo/libkyahoo/yabentry.h @@ -44,7 +44,6 @@ struct YABEntry TQString additionalNumber; TQString altEmail1; TQString altEmail2; - TQString imAIM; TQString imICQ; TQString imGoogleTalk; TQString imSkype; diff --git a/kopete/protocols/yahoo/ui/yahoouserinfodialog.cpp b/kopete/protocols/yahoo/ui/yahoouserinfodialog.cpp index 8164bae3..16b69b6d 100644 --- a/kopete/protocols/yahoo/ui/yahoouserinfodialog.cpp +++ b/kopete/protocols/yahoo/ui/yahoouserinfodialog.cpp @@ -116,7 +116,6 @@ void YahooUserInfoDialog::slotSaveAndCloseClicked() entry.additional3 = m_otherInfoWidget->note3Edit->text(); entry.additional4 = m_otherInfoWidget->note4Edit->text(); entry.notes = m_otherInfoWidget->commentsEdit->text(); -// entry.imAIM = m_genInfoWidget->firstNameEdit->text(); // entry.imGoogleTalk = m_genInfoWidget->firstNameEdit->text(); // entry.imICQ = m_genInfoWidget->firstNameEdit->text(); // entry.imIRC = m_genInfoWidget->firstNameEdit->text(); @@ -186,7 +185,6 @@ void YahooUserInfoDialog::slotUser2() entry.additional3 = m_otherInfoWidget->note3Edit->text().isEmpty() ? oldEntry->additional3 : m_otherInfoWidget->note3Edit->text(); entry.additional4 = m_otherInfoWidget->note4Edit->text().isEmpty() ? oldEntry->additional4 : m_otherInfoWidget->note4Edit->text(); entry.notes = m_otherInfoWidget->commentsEdit->text().isEmpty() ? oldEntry->notes : m_otherInfoWidget->commentsEdit->text(); - // entry.imAIM = m_genInfoWidget->firstNameEdit->text().isEmpty() ? oldEntry->notes : m_otherInfoWidget->commentsEdit->text(); // entry.imGoogleTalk = m_genInfoWidget->firstNameEdit->text().isEmpty() ? oldEntry->notes : m_otherInfoWidget->commentsEdit->text(); // entry.imICQ = m_genInfoWidget->firstNameEdit->text().isEmpty() ? oldEntry->notes : m_otherInfoWidget->commentsEdit->text(); // entry.imIRC = m_genInfoWidget->firstNameEdit->text().isEmpty() ? oldEntry->notes : m_otherInfoWidget->commentsEdit->text(); diff --git a/kopete/protocols/yahoo/yahoocontact.cpp b/kopete/protocols/yahoo/yahoocontact.cpp index 8d9c5b00..4db7ed59 100644 --- a/kopete/protocols/yahoo/yahoocontact.cpp +++ b/kopete/protocols/yahoo/yahoocontact.cpp @@ -735,7 +735,6 @@ void YahooContact::writeYABEntry() setProperty( YahooProtocol::protocol()->propAdditionalNumber, m_YABEntry->additionalNumber ); setProperty( YahooProtocol::protocol()->propAltEmail1, m_YABEntry->altEmail1 ); setProperty( YahooProtocol::protocol()->propAltEmail2, m_YABEntry->altEmail2 ); - setProperty( YahooProtocol::protocol()->propImAIM, m_YABEntry->imAIM ); setProperty( YahooProtocol::protocol()->propImICQ, m_YABEntry->imICQ ); setProperty( YahooProtocol::protocol()->propImGoogleTalk, m_YABEntry->imGoogleTalk ); setProperty( YahooProtocol::protocol()->propImSkype, m_YABEntry->imSkype ); @@ -797,7 +796,6 @@ void YahooContact::readYABEntry() m_YABEntry->additionalNumber = property( YahooProtocol::protocol()->propAdditionalNumber ).value().toString(); m_YABEntry->altEmail1 = property( YahooProtocol::protocol()->propAltEmail1 ).value().toString(); m_YABEntry->altEmail2 = property( YahooProtocol::protocol()->propAltEmail2 ).value().toString(); - m_YABEntry->imAIM = property( YahooProtocol::protocol()->propImAIM ).value().toString(); m_YABEntry->imICQ = property( YahooProtocol::protocol()->propImICQ ).value().toString(); m_YABEntry->imGoogleTalk = property( YahooProtocol::protocol()->propImGoogleTalk ).value().toString(); m_YABEntry->imSkype = property( YahooProtocol::protocol()->propImSkype ).value().toString(); diff --git a/kopete/protocols/yahoo/yahooprotocol.cpp b/kopete/protocols/yahoo/yahooprotocol.cpp index 6b0328d6..371b264a 100644 --- a/kopete/protocols/yahoo/yahooprotocol.cpp +++ b/kopete/protocols/yahoo/yahooprotocol.cpp @@ -71,7 +71,6 @@ YahooProtocol::YahooProtocol( TQObject *parent, const char *name, const TQString propAdditionalNumber("YABAdditionalNumber", i18n("Additional number"), TQString(), true, false), propAltEmail1("YABAlternativeEmail1", i18n("Alternative email 1"), TQString(), true, false), propAltEmail2("YABAlternativeEmail2", i18n("Alternative email 1"), TQString(), true, false), - propImAIM("YABIMAIM", i18n("AIM"), TQString(), true, false), propImICQ("YABIMICQ", i18n("ICQ"), TQString(), true, false), propImGoogleTalk("YABIMGoogleTalk", i18n("GoogleTalk"), TQString(), true, false), propImSkype("YABIMSkype", i18n("Skype"), TQString(), true, false), diff --git a/kopete/protocols/yahoo/yahooprotocol.h b/kopete/protocols/yahoo/yahooprotocol.h index 4370e69f..cd42d61f 100644 --- a/kopete/protocols/yahoo/yahooprotocol.h +++ b/kopete/protocols/yahoo/yahooprotocol.h @@ -87,7 +87,6 @@ public: const Kopete::ContactPropertyTmpl propAdditionalNumber; const Kopete::ContactPropertyTmpl propAltEmail1; const Kopete::ContactPropertyTmpl propAltEmail2; - const Kopete::ContactPropertyTmpl propImAIM; const Kopete::ContactPropertyTmpl propImICQ; const Kopete::ContactPropertyTmpl propImGoogleTalk; const Kopete::ContactPropertyTmpl propImSkype; -- cgit v1.2.1