summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber/jabberclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/jabber/jabberclient.cpp')
-rw-r--r--kopete/protocols/jabber/jabberclient.cpp218
1 files changed, 109 insertions, 109 deletions
diff --git a/kopete/protocols/jabber/jabberclient.cpp b/kopete/protocols/jabber/jabberclient.cpp
index b8e05d48..41157aaa 100644
--- a/kopete/protocols/jabber/jabberclient.cpp
+++ b/kopete/protocols/jabber/jabberclient.cpp
@@ -21,8 +21,8 @@
#include "jabberclient.h"
-#include <qtimer.h>
-#include <qregexp.h>
+#include <tqtimer.h>
+#include <tqregexp.h>
#include <qca.h>
#include <bsocket.h>
@@ -55,7 +55,7 @@ public:
// connection details
XMPP::Jid jid;
- QString password;
+ TQString password;
// XMPP backend
XMPP::Client *jabberClient;
@@ -70,12 +70,12 @@ public:
// current S5B server instance
static XMPP::S5BServer *s5bServer;
// address list being handled by the S5B server instance
- static QStringList s5bAddressList;
+ static TQStringList s5bAddressList;
// port of S5B server
static int s5bServerPort;
// local IP address
- QString localAddress;
+ TQString localAddress;
// whether TLS (or direct SSL in case of the old protocol) should be used
bool forceTLS;
@@ -91,7 +91,7 @@ public:
// override the default server name and port (only pre-XMPP 1.0)
bool overrideHost;
- QString server;
+ TQString server;
int port;
// allow transmission of plaintext passwords
@@ -104,19 +104,19 @@ public:
int currentPenaltyTime;
// client information
- QString clientName, clientVersion, osName;
+ TQString clientName, clientVersion, osName;
// timezone information
- QString timeZoneName;
+ TQString timeZoneName;
int timeZoneOffset;
// Caps(JEP-0115: Entity Capabilities) information
- QString capsNode, capsVersion;
+ TQString capsNode, capsVersion;
DiscoItem::Identity discoIdentity;
};
XMPP::S5BServer *JabberClient::Private::s5bServer = 0L;
-QStringList JabberClient::Private::s5bAddressList;
+TQStringList JabberClient::Private::s5bAddressList;
int JabberClient::Private::s5bServerPort = 8010;
JabberClient::JabberClient ()
@@ -126,7 +126,7 @@ JabberClient::JabberClient ()
cleanUp ();
// initiate penalty timer
- QTimer::singleShot ( JABBER_PENALTY_TIME * 1000, this, SLOT ( slotUpdatePenaltyTime () ) );
+ TQTimer::singleShot ( JABBER_PENALTY_TIME * 1000, this, TQT_SLOT ( slotUpdatePenaltyTime () ) );
}
@@ -157,7 +157,7 @@ void JabberClient::cleanUp ()
d->currentPenaltyTime = 0;
d->jid = XMPP::Jid ();
- d->password = QString::null;
+ d->password = TQString::null;
setForceTLS ( false );
setUseSSL ( false );
@@ -171,9 +171,9 @@ void JabberClient::cleanUp ()
setFileTransfersEnabled ( false );
setS5BServerPort ( 8010 );
- setClientName ( QString::null );
- setClientVersion ( QString::null );
- setOSName ( QString::null );
+ setClientName ( TQString::null );
+ setClientVersion ( TQString::null );
+ setOSName ( TQString::null );
setTimeZone ( "UTC", 0 );
@@ -189,7 +189,7 @@ void JabberClient::slotUpdatePenaltyTime ()
else
d->currentPenaltyTime = 0;
- QTimer::singleShot ( JABBER_PENALTY_TIME * 1000, this, SLOT ( slotUpdatePenaltyTime () ) );
+ TQTimer::singleShot ( JABBER_PENALTY_TIME * 1000, this, TQT_SLOT ( slotUpdatePenaltyTime () ) );
}
@@ -234,7 +234,7 @@ XMPP::S5BServer *JabberClient::s5bServer ()
if ( !d->s5bServer )
{
d->s5bServer = new XMPP::S5BServer ();
- QObject::connect ( d->s5bServer, SIGNAL ( destroyed () ), this, SLOT ( slotS5BServerGone () ) );
+ TQObject::connect ( d->s5bServer, TQT_SIGNAL ( destroyed () ), this, TQT_SLOT ( slotS5BServerGone () ) );
/*
* Try to start the server at the default port here.
@@ -263,14 +263,14 @@ void JabberClient::slotS5BServerGone ()
}
-void JabberClient::addS5BServerAddress ( const QString &address )
+void JabberClient::addS5BServerAddress ( const TQString &address )
{
- QStringList newList;
+ TQStringList newList;
d->s5bAddressList.append ( address );
// now filter the list without dupes
- for ( QStringList::Iterator it = d->s5bAddressList.begin (); it != d->s5bAddressList.end (); ++it )
+ for ( TQStringList::Iterator it = d->s5bAddressList.begin (); it != d->s5bAddressList.end (); ++it )
{
if ( !newList.contains ( *it ) )
newList.append ( *it );
@@ -280,11 +280,11 @@ void JabberClient::addS5BServerAddress ( const QString &address )
}
-void JabberClient::removeS5BServerAddress ( const QString &address )
+void JabberClient::removeS5BServerAddress ( const TQString &address )
{
- QStringList newList;
+ TQStringList newList;
- QStringList::iterator it = d->s5bAddressList.find ( address );
+ TQStringList::iterator it = d->s5bAddressList.find ( address );
if ( it != d->s5bAddressList.end () )
{
d->s5bAddressList.remove ( it );
@@ -298,7 +298,7 @@ void JabberClient::removeS5BServerAddress ( const QString &address )
else
{
// now filter the list without dupes
- for ( QStringList::Iterator it = d->s5bAddressList.begin (); it != d->s5bAddressList.end (); ++it )
+ for ( TQStringList::Iterator it = d->s5bAddressList.begin (); it != d->s5bAddressList.end (); ++it )
{
if ( !newList.contains ( *it ) )
newList.append ( *it );
@@ -365,7 +365,7 @@ bool JabberClient::probeSSL () const
}
-void JabberClient::setOverrideHost ( bool flag, const QString &server, int port )
+void JabberClient::setOverrideHost ( bool flag, const TQString &server, int port )
{
d->overrideHost = flag;
@@ -395,7 +395,7 @@ bool JabberClient::allowPlainTextPassword () const
}
-void JabberClient::setFileTransfersEnabled ( bool flag, const QString &localAddress )
+void JabberClient::setFileTransfersEnabled ( bool flag, const TQString &localAddress )
{
d->fileTransfersEnabled = flag;
@@ -403,7 +403,7 @@ void JabberClient::setFileTransfersEnabled ( bool flag, const QString &localAddr
}
-QString JabberClient::localAddress () const
+TQString JabberClient::localAddress () const
{
return d->localAddress;
@@ -417,76 +417,76 @@ bool JabberClient::fileTransfersEnabled () const
}
-void JabberClient::setClientName ( const QString &clientName )
+void JabberClient::setClientName ( const TQString &clientName )
{
d->clientName = clientName;
}
-QString JabberClient::clientName () const
+TQString JabberClient::clientName () const
{
return d->clientName;
}
-void JabberClient::setClientVersion ( const QString &clientVersion )
+void JabberClient::setClientVersion ( const TQString &clientVersion )
{
d->clientVersion = clientVersion;
}
-QString JabberClient::clientVersion () const
+TQString JabberClient::clientVersion () const
{
return d->clientVersion;
}
-void JabberClient::setOSName ( const QString &osName )
+void JabberClient::setOSName ( const TQString &osName )
{
d->osName = osName;
}
-QString JabberClient::osName () const
+TQString JabberClient::osName () const
{
return d->osName;
}
-void JabberClient::setCapsNode( const QString &capsNode )
+void JabberClient::setCapsNode( const TQString &capsNode )
{
d->capsNode = capsNode;
}
-QString JabberClient::capsNode() const
+TQString JabberClient::capsNode() const
{
return d->capsNode;
}
-void JabberClient::setCapsVersion( const QString &capsVersion )
+void JabberClient::setCapsVersion( const TQString &capsVersion )
{
d->capsVersion = capsVersion;
}
-QString JabberClient::capsVersion() const
+TQString JabberClient::capsVersion() const
{
return d->capsVersion;
}
-QString JabberClient::capsExt() const
+TQString JabberClient::capsExt() const
{
if(d->jabberClient)
{
return d->jabberClient->capsExt();
}
- return QString();
+ return TQString();
}
void JabberClient::setDiscoIdentity( DiscoItem::Identity identity )
{
@@ -498,7 +498,7 @@ DiscoItem::Identity JabberClient::discoIdentity() const
return d->discoIdentity;
}
-void JabberClient::setTimeZone ( const QString &timeZoneName, int timeZoneOffset )
+void JabberClient::setTimeZone ( const TQString &timeZoneName, int timeZoneOffset )
{
d->timeZoneName = timeZoneName;
@@ -506,7 +506,7 @@ void JabberClient::setTimeZone ( const QString &timeZoneName, int timeZoneOffset
}
-QString JabberClient::timeZoneName () const
+TQString JabberClient::timeZoneName () const
{
return d->timeZoneName;
@@ -587,7 +587,7 @@ XMPP::Jid JabberClient::jid () const
}
-JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QString &password, bool auth )
+JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const TQString &password, bool auth )
{
/*
* Close any existing connection.
@@ -638,10 +638,10 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
{
using namespace XMPP;
- QObject::connect ( d->jabberTLSHandler, SIGNAL ( tlsHandshaken() ), this, SLOT ( slotTLSHandshaken () ) );
+ TQObject::connect ( d->jabberTLSHandler, TQT_SIGNAL ( tlsHandshaken() ), this, TQT_SLOT ( slotTLSHandshaken () ) );
}
- QPtrList<QCA::Cert> certStore;
+ TQPtrList<QCA::Cert> certStore;
d->jabberTLS->setCertificateStore ( certStore );
}
@@ -653,18 +653,18 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
{
using namespace XMPP;
- QObject::connect ( d->jabberClientStream, SIGNAL ( needAuthParams(bool, bool, bool) ),
- this, SLOT ( slotCSNeedAuthParams (bool, bool, bool) ) );
- QObject::connect ( d->jabberClientStream, SIGNAL ( authenticated () ),
- this, SLOT ( slotCSAuthenticated () ) );
- QObject::connect ( d->jabberClientStream, SIGNAL ( connectionClosed () ),
- this, SLOT ( slotCSDisconnected () ) );
- QObject::connect ( d->jabberClientStream, SIGNAL ( delayedCloseFinished () ),
- this, SLOT ( slotCSDisconnected () ) );
- QObject::connect ( d->jabberClientStream, SIGNAL ( warning (int) ),
- this, SLOT ( slotCSWarning (int) ) );
- QObject::connect ( d->jabberClientStream, SIGNAL ( error (int) ),
- this, SLOT ( slotCSError (int) ) );
+ TQObject::connect ( d->jabberClientStream, TQT_SIGNAL ( needAuthParams(bool, bool, bool) ),
+ this, TQT_SLOT ( slotCSNeedAuthParams (bool, bool, bool) ) );
+ TQObject::connect ( d->jabberClientStream, TQT_SIGNAL ( authenticated () ),
+ this, TQT_SLOT ( slotCSAuthenticated () ) );
+ TQObject::connect ( d->jabberClientStream, TQT_SIGNAL ( connectionClosed () ),
+ this, TQT_SLOT ( slotCSDisconnected () ) );
+ TQObject::connect ( d->jabberClientStream, TQT_SIGNAL ( delayedCloseFinished () ),
+ this, TQT_SLOT ( slotCSDisconnected () ) );
+ TQObject::connect ( d->jabberClientStream, TQT_SIGNAL ( warning (int) ),
+ this, TQT_SLOT ( slotCSWarning (int) ) );
+ TQObject::connect ( d->jabberClientStream, TQT_SIGNAL ( error (int) ),
+ this, TQT_SLOT ( slotCSError (int) ) );
}
d->jabberClientStream->setOldOnly ( useXMPP09 () );
@@ -694,8 +694,8 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
{
using namespace XMPP;
- QObject::connect ( d->jabberClient->fileTransferManager(), SIGNAL ( incomingReady() ),
- this, SLOT ( slotIncomingFileTransfer () ) );
+ TQObject::connect ( d->jabberClient->fileTransferManager(), TQT_SIGNAL ( incomingReady() ),
+ this, TQT_SLOT ( slotIncomingFileTransfer () ) );
}
}
@@ -704,36 +704,36 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
*/
{
using namespace XMPP;
- QObject::connect ( d->jabberClient, SIGNAL ( subscription (const Jid &, const QString &) ),
- this, SLOT ( slotSubscription (const Jid &, const QString &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( rosterRequestFinished ( bool, int, const QString & ) ),
- this, SLOT ( slotRosterRequestFinished ( bool, int, const QString & ) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( rosterItemAdded (const RosterItem &) ),
- this, SLOT ( slotNewContact (const RosterItem &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( rosterItemUpdated (const RosterItem &) ),
- this, SLOT ( slotContactUpdated (const RosterItem &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( rosterItemRemoved (const RosterItem &) ),
- this, SLOT ( slotContactDeleted (const RosterItem &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( resourceAvailable (const Jid &, const Resource &) ),
- this, SLOT ( slotResourceAvailable (const Jid &, const Resource &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( resourceUnavailable (const Jid &, const Resource &) ),
- this, SLOT ( slotResourceUnavailable (const Jid &, const Resource &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( messageReceived (const Message &) ),
- this, SLOT ( slotReceivedMessage (const Message &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( groupChatJoined (const Jid &) ),
- this, SLOT ( slotGroupChatJoined (const Jid &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( groupChatLeft (const Jid &) ),
- this, SLOT ( slotGroupChatLeft (const Jid &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( groupChatPresence (const Jid &, const Status &) ),
- this, SLOT ( slotGroupChatPresence (const Jid &, const Status &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( groupChatError (const Jid &, int, const QString &) ),
- this, SLOT ( slotGroupChatError (const Jid &, int, const QString &) ) );
- //QObject::connect ( d->jabberClient, SIGNAL (debugText (const QString &) ),
- // this, SLOT ( slotPsiDebug (const QString &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( xmlIncoming(const QString& ) ),
- this, SLOT ( slotIncomingXML (const QString &) ) );
- QObject::connect ( d->jabberClient, SIGNAL ( xmlOutgoing(const QString& ) ),
- this, SLOT ( slotOutgoingXML (const QString &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( subscription (const Jid &, const TQString &) ),
+ this, TQT_SLOT ( slotSubscription (const Jid &, const TQString &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( rosterRequestFinished ( bool, int, const TQString & ) ),
+ this, TQT_SLOT ( slotRosterRequestFinished ( bool, int, const TQString & ) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( rosterItemAdded (const RosterItem &) ),
+ this, TQT_SLOT ( slotNewContact (const RosterItem &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( rosterItemUpdated (const RosterItem &) ),
+ this, TQT_SLOT ( slotContactUpdated (const RosterItem &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( rosterItemRemoved (const RosterItem &) ),
+ this, TQT_SLOT ( slotContactDeleted (const RosterItem &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( resourceAvailable (const Jid &, const Resource &) ),
+ this, TQT_SLOT ( slotResourceAvailable (const Jid &, const Resource &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( resourceUnavailable (const Jid &, const Resource &) ),
+ this, TQT_SLOT ( slotResourceUnavailable (const Jid &, const Resource &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( messageReceived (const Message &) ),
+ this, TQT_SLOT ( slotReceivedMessage (const Message &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( groupChatJoined (const Jid &) ),
+ this, TQT_SLOT ( slotGroupChatJoined (const Jid &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( groupChatLeft (const Jid &) ),
+ this, TQT_SLOT ( slotGroupChatLeft (const Jid &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( groupChatPresence (const Jid &, const Status &) ),
+ this, TQT_SLOT ( slotGroupChatPresence (const Jid &, const Status &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( groupChatError (const Jid &, int, const TQString &) ),
+ this, TQT_SLOT ( slotGroupChatError (const Jid &, int, const TQString &) ) );
+ //TQObject::connect ( d->jabberClient, TQT_SIGNAL (debugText (const TQString &) ),
+ // this, TQT_SLOT ( slotPsiDebug (const TQString &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( xmlIncoming(const TQString& ) ),
+ this, TQT_SLOT ( slotIncomingXML (const TQString &) ) );
+ TQObject::connect ( d->jabberClient, TQT_SIGNAL ( xmlOutgoing(const TQString& ) ),
+ this, TQT_SLOT ( slotOutgoingXML (const TQString &) ) );
}
d->jabberClient->setClientName ( clientName () );
@@ -802,33 +802,33 @@ bool JabberClient::isConnected () const
}
-void JabberClient::joinGroupChat ( const QString &host, const QString &room, const QString &nick )
+void JabberClient::joinGroupChat ( const TQString &host, const TQString &room, const TQString &nick )
{
client()->groupChatJoin ( host, room, nick );
}
-void JabberClient::joinGroupChat ( const QString &host, const QString &room, const QString &nick, const QString &password )
+void JabberClient::joinGroupChat ( const TQString &host, const TQString &room, const TQString &nick, const TQString &password )
{
client()->groupChatJoin ( host, room, nick, password );
}
-void JabberClient::leaveGroupChat ( const QString &host, const QString &room )
+void JabberClient::leaveGroupChat ( const TQString &host, const TQString &room )
{
client()->groupChatLeave ( host, room );
}
-void JabberClient::setGroupChatStatus( const QString & host, const QString & room, const XMPP::Status & status )
+void JabberClient::setGroupChatStatus( const TQString & host, const TQString & room, const XMPP::Status & status )
{
client()->groupChatSetStatus( host, room, status);
}
-void JabberClient::changeGroupChatNick( const QString & host, const QString & room, const QString & nick, const XMPP::Status & status )
+void JabberClient::changeGroupChatNick( const TQString & host, const TQString & room, const TQString & nick, const XMPP::Status & status )
{
client()->groupChatChangeNick( host, room, nick, status );
}
@@ -841,7 +841,7 @@ void JabberClient::sendMessage ( const XMPP::Message &message )
}
-void JabberClient::send ( const QString &packet )
+void JabberClient::send ( const TQString &packet )
{
client()->send ( packet );
@@ -855,34 +855,34 @@ void JabberClient::requestRoster ()
}
-void JabberClient::slotPsiDebug ( const QString & _msg )
+void JabberClient::slotPsiDebug ( const TQString & _msg )
{
- QString msg = _msg;
+ TQString msg = _msg;
- msg = msg.replace( QRegExp( "<password>[^<]*</password>\n" ), "<password>[Filtered]</password>\n" );
- msg = msg.replace( QRegExp( "<digest>[^<]*</digest>\n" ), "<digest>[Filtered]</digest>\n" );
+ msg = msg.replace( TQRegExp( "<password>[^<]*</password>\n" ), "<password>[Filtered]</password>\n" );
+ msg = msg.replace( TQRegExp( "<digest>[^<]*</digest>\n" ), "<digest>[Filtered]</digest>\n" );
emit debugMessage ( "Psi: " + msg );
}
-void JabberClient::slotIncomingXML ( const QString & _msg )
+void JabberClient::slotIncomingXML ( const TQString & _msg )
{
- QString msg = _msg;
+ TQString msg = _msg;
- msg = msg.replace( QRegExp( "<password>[^<]*</password>\n" ), "<password>[Filtered]</password>\n" );
- msg = msg.replace( QRegExp( "<digest>[^<]*</digest>\n" ), "<digest>[Filtered]</digest>\n" );
+ msg = msg.replace( TQRegExp( "<password>[^<]*</password>\n" ), "<password>[Filtered]</password>\n" );
+ msg = msg.replace( TQRegExp( "<digest>[^<]*</digest>\n" ), "<digest>[Filtered]</digest>\n" );
emit debugMessage ( "XML IN: " + msg );
}
-void JabberClient::slotOutgoingXML ( const QString & _msg )
+void JabberClient::slotOutgoingXML ( const TQString & _msg )
{
- QString msg = _msg;
+ TQString msg = _msg;
- msg = msg.replace( QRegExp( "<password>[^<]*</password>\n" ), "<password>[Filtered]</password>\n" );
- msg = msg.replace( QRegExp( "<digest>[^<]*</digest>\n" ), "<digest>[Filtered]</digest>\n" );
+ msg = msg.replace( TQRegExp( "<password>[^<]*</password>\n" ), "<password>[Filtered]</password>\n" );
+ msg = msg.replace( TQRegExp( "<digest>[^<]*</digest>\n" ), "<digest>[Filtered]</digest>\n" );
emit debugMessage ( "XML OUT: " + msg );
@@ -1042,7 +1042,7 @@ void JabberClient::slotCSError ( int error )
}
-void JabberClient::slotRosterRequestFinished ( bool success, int /*statusCode*/, const QString &/*statusString*/ )
+void JabberClient::slotRosterRequestFinished ( bool success, int /*statusCode*/, const TQString &/*statusString*/ )
{
emit rosterRequestFinished ( success );
@@ -1119,14 +1119,14 @@ void JabberClient::slotGroupChatPresence ( const Jid &jid, const Status &status)
}
-void JabberClient::slotGroupChatError ( const Jid &jid, int error, const QString &reason)
+void JabberClient::slotGroupChatError ( const Jid &jid, int error, const TQString &reason)
{
emit groupChatError ( jid, error, reason );
}
-void JabberClient::slotSubscription ( const Jid &jid, const QString &type )
+void JabberClient::slotSubscription ( const Jid &jid, const TQString &type )
{
emit subscription ( jid, type );