diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp')
-rw-r--r-- | kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp | 298 |
1 files changed, 149 insertions, 149 deletions
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp index 5482e2b3..d3182ffe 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp @@ -44,9 +44,9 @@ #include"xmpp.h" -#include<qtextstream.h> -#include<qguardedptr.h> -#include<qtimer.h> +#include<tqtextstream.h> +#include<tqguardedptr.h> +#include<tqtimer.h> #include<qca.h> #include<stdlib.h> #include"bytestream.h" @@ -70,15 +70,15 @@ void XMPP::setDebug(Debug *p) debug_ptr = p; } -static QByteArray randomArray(int size) +static TQByteArray randomArray(int size) { - QByteArray a(size); + TQByteArray a(size); for(int n = 0; n < size; ++n) a[n] = (char)(256.0*rand()/(RAND_MAX+1.0)); return a; } -static QString genId() +static TQString genId() { // need SHA1 here if(!QCA::isSupported(QCA::CAP_SHA1)) @@ -90,7 +90,7 @@ static QString genId() //---------------------------------------------------------------------------- // Stanza //---------------------------------------------------------------------------- -Stanza::Error::Error(int _type, int _condition, const QString &_text, const QDomElement &_appSpec) +Stanza::Error::Error(int _type, int _condition, const TQString &_text, const TQDomElement &_appSpec) { type = _type; condition = _condition; @@ -115,7 +115,7 @@ public: }; static ErrorCondEntry errorCondTable[]; - static int stringToKind(const QString &s) + static int stringToKind(const TQString &s) { if(s == "message") return Message; @@ -127,7 +127,7 @@ public: return -1; } - static QString kindToString(Kind k) + static TQString kindToString(Kind k) { if(k == Message) return "message"; @@ -137,7 +137,7 @@ public: return "iq"; } - static int stringToErrorType(const QString &s) + static int stringToErrorType(const TQString &s) { for(int n = 0; errorTypeTable[n].str; ++n) { if(s == errorTypeTable[n].str) @@ -146,16 +146,16 @@ public: return -1; } - static QString errorTypeToString(int x) + static TQString errorTypeToString(int x) { for(int n = 0; errorTypeTable[n].str; ++n) { if(x == errorTypeTable[n].type) return errorTypeTable[n].str; } - return QString(); + return TQString(); } - static int stringToErrorCond(const QString &s) + static int stringToErrorCond(const TQString &s) { for(int n = 0; errorCondTable[n].str; ++n) { if(s == errorCondTable[n].str) @@ -164,17 +164,17 @@ public: return -1; } - static QString errorCondToString(int x) + static TQString errorCondToString(int x) { for(int n = 0; errorCondTable[n].str; ++n) { if(x == errorCondTable[n].cond) return errorCondTable[n].str; } - return QString(); + return TQString(); } Stream *s; - QDomElement e; + TQDomElement e; }; Stanza::Private::ErrorTypeEntry Stanza::Private::errorTypeTable[] = @@ -215,7 +215,7 @@ Stanza::Stanza() d = 0; } -Stanza::Stanza(Stream *s, Kind k, const Jid &to, const QString &type, const QString &id) +Stanza::Stanza(Stream *s, Kind k, const Jid &to, const TQString &type, const TQString &id) { d = new Private; @@ -235,7 +235,7 @@ Stanza::Stanza(Stream *s, Kind k, const Jid &to, const QString &type, const QStr setId(id); } -Stanza::Stanza(Stream *s, const QDomElement &e) +Stanza::Stanza(Stream *s, const TQDomElement &e) { d = 0; if(e.namespaceURI() != s->baseNS()) @@ -273,59 +273,59 @@ bool Stanza::isNull() const return (d ? false: true); } -QDomElement Stanza::element() const +TQDomElement Stanza::element() const { return d->e; } -QString Stanza::toString() const +TQString Stanza::toString() const { return Stream::xmlToString(d->e); } -QDomDocument & Stanza::doc() const +TQDomDocument & Stanza::doc() const { return d->s->doc(); } -QString Stanza::baseNS() const +TQString Stanza::baseNS() const { return d->s->baseNS(); } -QString Stanza::xhtmlImNS() const +TQString Stanza::xhtmlImNS() const { return d->s->xhtmlImNS(); } -QString Stanza::xhtmlNS() const +TQString Stanza::xhtmlNS() const { return d->s->xhtmlNS(); } -QDomElement Stanza::createElement(const QString &ns, const QString &tagName) +TQDomElement Stanza::createElement(const TQString &ns, const TQString &tagName) { return d->s->doc().createElementNS(ns, tagName); } -QDomElement Stanza::createTextElement(const QString &ns, const QString &tagName, const QString &text) +TQDomElement Stanza::createTextElement(const TQString &ns, const TQString &tagName, const TQString &text) { - QDomElement e = d->s->doc().createElementNS(ns, tagName); + TQDomElement e = d->s->doc().createElementNS(ns, tagName); e.appendChild(d->s->doc().createTextNode(text)); return e; } -QDomElement Stanza::createXHTMLElement(const QString &xHTML) +TQDomElement Stanza::createXHTMLElement(const TQString &xHTML) { - QDomDocument doc; + TQDomDocument doc; doc.setContent(xHTML, true); - QDomElement root = doc.documentElement(); - //QDomElement e; + TQDomElement root = doc.documentElement(); + //TQDomElement e; return (root); } -void Stanza::appendChild(const QDomElement &e) +void Stanza::appendChild(const TQDomElement &e) { d->e.appendChild(e); } @@ -350,19 +350,19 @@ Jid Stanza::from() const return Jid(d->e.attribute("from")); } -QString Stanza::id() const +TQString Stanza::id() const { return d->e.attribute("id"); } -QString Stanza::type() const +TQString Stanza::type() const { return d->e.attribute("type"); } -QString Stanza::lang() const +TQString Stanza::lang() const { - return d->e.attributeNS(NS_XML, "lang", QString()); + return d->e.attributeNS(NS_XML, "lang", TQString()); } void Stanza::setTo(const Jid &j) @@ -375,17 +375,17 @@ void Stanza::setFrom(const Jid &j) d->e.setAttribute("from", j.full()); } -void Stanza::setId(const QString &id) +void Stanza::setId(const TQString &id) { d->e.setAttribute("id", id); } -void Stanza::setType(const QString &type) +void Stanza::setType(const TQString &type) { d->e.setAttribute("type", type); } -void Stanza::setLang(const QString &lang) +void Stanza::setLang(const TQString &lang) { d->e.setAttribute("xml:lang", lang); } @@ -393,7 +393,7 @@ void Stanza::setLang(const QString &lang) Stanza::Error Stanza::error() const { Error err; - QDomElement e = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement(); + TQDomElement e = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement(); if(e.isNull()) return err; @@ -403,11 +403,11 @@ Stanza::Error Stanza::error() const err.type = x; // condition: find first element - QDomNodeList nl = e.childNodes(); - QDomElement t; + TQDomNodeList nl = e.childNodes(); + TQDomElement t; uint n; for(n = 0; n < nl.count(); ++n) { - QDomNode i = nl.item(n); + TQDomNode i = nl.item(n); if(i.isElement()) { t = i.toElement(); break; @@ -429,7 +429,7 @@ Stanza::Error Stanza::error() const // appspec: find first non-standard namespaced element nl = e.childNodes(); for(n = 0; n < nl.count(); ++n) { - QDomNode i = nl.item(n); + TQDomNode i = nl.item(n); if(i.isElement() && i.namespaceURI() != NS_STANZAS) { err.appSpec = i.toElement(); break; @@ -441,7 +441,7 @@ Stanza::Error Stanza::error() const void Stanza::setError(const Error &err) { // create the element if necessary - QDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement(); + TQDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement(); if(errElem.isNull()) { errElem = d->e.ownerDocument().createElementNS(d->s->baseNS(), "error"); d->e.appendChild(errElem); @@ -449,13 +449,13 @@ void Stanza::setError(const Error &err) // error type/condition if(d->s->old()) { - errElem.setAttribute("code", QString::number(err.condition)); + errElem.setAttribute("code", TQString::number(err.condition)); } else { - QString stype = Private::errorTypeToString(err.type); + TQString stype = Private::errorTypeToString(err.type); if(stype.isEmpty()) return; - QString scond = Private::errorCondToString(err.condition); + TQString scond = Private::errorCondToString(err.condition); if(scond.isEmpty()) return; @@ -468,7 +468,7 @@ void Stanza::setError(const Error &err) errElem.appendChild(d->e.ownerDocument().createTextNode(err.text)); } else { - QDomElement te = d->e.ownerDocument().createElementNS(d->s->baseNS(), "text"); + TQDomElement te = d->e.ownerDocument().createElementNS(d->s->baseNS(), "text"); te.appendChild(d->e.ownerDocument().createTextNode(err.text)); errElem.appendChild(te); } @@ -479,7 +479,7 @@ void Stanza::setError(const Error &err) void Stanza::clearError() { - QDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement(); + TQDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement(); if(!errElem.isNull()) d->e.removeChild(errElem); } @@ -488,8 +488,8 @@ void Stanza::clearError() // Stream //---------------------------------------------------------------------------- static XmlProtocol *foo = 0; -Stream::Stream(QObject *parent) -:QObject(parent) +Stream::Stream(TQObject *parent) +:TQObject(parent) { } @@ -497,17 +497,17 @@ Stream::~Stream() { } -Stanza Stream::createStanza(Stanza::Kind k, const Jid &to, const QString &type, const QString &id) +Stanza Stream::createStanza(Stanza::Kind k, const Jid &to, const TQString &type, const TQString &id) { return Stanza(this, k, to, type, id); } -Stanza Stream::createStanza(const QDomElement &e) +Stanza Stream::createStanza(const TQDomElement &e) { return Stanza(this, e); } -QString Stream::xmlToString(const QDomElement &e, bool clip) +TQString Stream::xmlToString(const TQDomElement &e, bool clip) { if(!foo) foo = new CoreProtocol; @@ -569,14 +569,14 @@ public: } Jid jid; - QString server; + TQString server; bool oldOnly; bool allowPlain, mutualAuth; bool haveLocalAddr; - QHostAddress localAddr; + TQHostAddress localAddr; Q_UINT16 localPort; int minimumSSF, maximumSSF; - QString sasl_mech; + TQString sasl_mech; bool doBinding; bool in_rrsig; @@ -590,7 +590,7 @@ public: CoreProtocol client; CoreProtocol srv; - QString defRealm; + TQString defRealm; int mode; int state; @@ -600,51 +600,51 @@ public: bool tls_warned, using_tls; bool doAuth; - QStringList sasl_mechlist; + TQStringList sasl_mechlist; int errCond; - QString errText; - QDomElement errAppSpec; + TQString errText; + TQDomElement errAppSpec; - QPtrList<Stanza> in; + TQPtrList<Stanza> in; - QTimer noopTimer; + TQTimer noopTimer; int noop_time; }; -ClientStream::ClientStream(Connector *conn, TLSHandler *tlsHandler, QObject *parent) +ClientStream::ClientStream(Connector *conn, TLSHandler *tlsHandler, TQObject *parent) :Stream(parent) { d = new Private; d->mode = Client; d->conn = conn; - connect(d->conn, SIGNAL(connected()), SLOT(cr_connected())); - connect(d->conn, SIGNAL(error()), SLOT(cr_error())); + connect(d->conn, TQT_SIGNAL(connected()), TQT_SLOT(cr_connected())); + connect(d->conn, TQT_SIGNAL(error()), TQT_SLOT(cr_error())); d->noop_time = 0; - connect(&d->noopTimer, SIGNAL(timeout()), SLOT(doNoop())); + connect(&d->noopTimer, TQT_SIGNAL(timeout()), TQT_SLOT(doNoop())); d->tlsHandler = tlsHandler; } -ClientStream::ClientStream(const QString &host, const QString &defRealm, ByteStream *bs, QCA::TLS *tls, QObject *parent) +ClientStream::ClientStream(const TQString &host, const TQString &defRealm, ByteStream *bs, QCA::TLS *tls, TQObject *parent) :Stream(parent) { d = new Private; d->mode = Server; d->bs = bs; - connect(d->bs, SIGNAL(connectionClosed()), SLOT(bs_connectionClosed())); - connect(d->bs, SIGNAL(delayedCloseFinished()), SLOT(bs_delayedCloseFinished())); - connect(d->bs, SIGNAL(error(int)), SLOT(bs_error(int))); + connect(d->bs, TQT_SIGNAL(connectionClosed()), TQT_SLOT(bs_connectionClosed())); + connect(d->bs, TQT_SIGNAL(delayedCloseFinished()), TQT_SLOT(bs_delayedCloseFinished())); + connect(d->bs, TQT_SIGNAL(error(int)), TQT_SLOT(bs_error(int))); - QByteArray spare = d->bs->read(); + TQByteArray spare = d->bs->read(); d->ss = new SecureStream(d->bs); - connect(d->ss, SIGNAL(readyRead()), SLOT(ss_readyRead())); - connect(d->ss, SIGNAL(bytesWritten(int)), SLOT(ss_bytesWritten(int))); - connect(d->ss, SIGNAL(tlsHandshaken()), SLOT(ss_tlsHandshaken())); - connect(d->ss, SIGNAL(tlsClosed()), SLOT(ss_tlsClosed())); - connect(d->ss, SIGNAL(error(int)), SLOT(ss_error(int))); + connect(d->ss, TQT_SIGNAL(readyRead()), TQT_SLOT(ss_readyRead())); + connect(d->ss, TQT_SIGNAL(bytesWritten(int)), TQT_SLOT(ss_bytesWritten(int))); + connect(d->ss, TQT_SIGNAL(tlsHandshaken()), TQT_SLOT(ss_tlsHandshaken())); + connect(d->ss, TQT_SIGNAL(tlsClosed()), TQT_SLOT(ss_tlsClosed())); + connect(d->ss, TQT_SIGNAL(error(int)), TQT_SLOT(ss_error(int))); d->server = host; d->defRealm = defRealm; @@ -655,7 +655,7 @@ ClientStream::ClientStream(const QString &host, const QString &defRealm, ByteStr //d->srv.startServerIn(genId()); //d->state = Connecting; //d->jid = Jid(); - //d->server = QString(); + //d->server = TQString(); } ClientStream::~ClientStream() @@ -761,13 +761,13 @@ bool ClientStream::isAuthenticated() const return (d->state == Active) ? true: false; } -void ClientStream::setUsername(const QString &s) +void ClientStream::setUsername(const TQString &s) { if(d->sasl) d->sasl->setUsername(s); } -void ClientStream::setPassword(const QString &s) +void ClientStream::setPassword(const TQString &s) { if(d->client.old) { d->client.setPassword(s); @@ -778,7 +778,7 @@ void ClientStream::setPassword(const QString &s) } } -void ClientStream::setRealm(const QString &s) +void ClientStream::setRealm(const TQString &s) { if(d->sasl) d->sasl->setRealm(s); @@ -817,7 +817,7 @@ void ClientStream::setNoopTime(int mills) d->noopTimer.start(d->noop_time); } -QString ClientStream::saslMechanism() const +TQString ClientStream::saslMechanism() const { return d->client.saslMech(); } @@ -827,12 +827,12 @@ int ClientStream::saslSSF() const return d->sasl_ssf; } -void ClientStream::setSASLMechanism(const QString &s) +void ClientStream::setSASLMechanism(const TQString &s) { d->sasl_mech = s; } -void ClientStream::setLocalAddr(const QHostAddress &addr, Q_UINT16 port) +void ClientStream::setLocalAddr(const TQHostAddress &addr, Q_UINT16 port) { d->haveLocalAddr = true; d->localAddr = addr; @@ -844,12 +844,12 @@ int ClientStream::errorCondition() const return d->errCond; } -QString ClientStream::errorText() const +TQString ClientStream::errorText() const { return d->errText; } -QDomElement ClientStream::errorAppSpec() const +TQDomElement ClientStream::errorAppSpec() const { return d->errAppSpec; } @@ -871,22 +871,22 @@ void ClientStream::close() } } -QDomDocument & ClientStream::doc() const +TQDomDocument & ClientStream::doc() const { return d->client.doc; } -QString ClientStream::baseNS() const +TQString ClientStream::baseNS() const { return NS_CLIENT; } -QString ClientStream::xhtmlImNS() const +TQString ClientStream::xhtmlImNS() const { return NS_XHTML_IM; } -QString ClientStream::xhtmlNS() const +TQString ClientStream::xhtmlNS() const { return NS_XHTML; } @@ -940,17 +940,17 @@ void ClientStream::write(const Stanza &s) void ClientStream::cr_connected() { d->bs = d->conn->stream(); - connect(d->bs, SIGNAL(connectionClosed()), SLOT(bs_connectionClosed())); - connect(d->bs, SIGNAL(delayedCloseFinished()), SLOT(bs_delayedCloseFinished())); + connect(d->bs, TQT_SIGNAL(connectionClosed()), TQT_SLOT(bs_connectionClosed())); + connect(d->bs, TQT_SIGNAL(delayedCloseFinished()), TQT_SLOT(bs_delayedCloseFinished())); - QByteArray spare = d->bs->read(); + TQByteArray spare = d->bs->read(); d->ss = new SecureStream(d->bs); - connect(d->ss, SIGNAL(readyRead()), SLOT(ss_readyRead())); - connect(d->ss, SIGNAL(bytesWritten(int)), SLOT(ss_bytesWritten(int))); - connect(d->ss, SIGNAL(tlsHandshaken()), SLOT(ss_tlsHandshaken())); - connect(d->ss, SIGNAL(tlsClosed()), SLOT(ss_tlsClosed())); - connect(d->ss, SIGNAL(error(int)), SLOT(ss_error(int))); + connect(d->ss, TQT_SIGNAL(readyRead()), TQT_SLOT(ss_readyRead())); + connect(d->ss, TQT_SIGNAL(bytesWritten(int)), TQT_SLOT(ss_bytesWritten(int))); + connect(d->ss, TQT_SIGNAL(tlsHandshaken()), TQT_SLOT(ss_tlsHandshaken())); + connect(d->ss, TQT_SIGNAL(tlsClosed()), TQT_SLOT(ss_tlsClosed())); + connect(d->ss, TQT_SIGNAL(error(int)), TQT_SLOT(ss_error(int))); //d->client.startDialbackOut("andbit.net", "im.pyxa.org"); //d->client.startServerOut(d->server); @@ -968,7 +968,7 @@ void ClientStream::cr_connected() d->client.doTLS = d->tlsHandler ? true: false; d->client.doBinding = d->doBinding;*/ - QGuardedPtr<QObject> self = this; + TQGuardedPtr<TQObject> self = this; connected(); if(!self) return; @@ -1008,10 +1008,10 @@ void ClientStream::bs_error(int) void ClientStream::ss_readyRead() { - QByteArray a = d->ss->read(); + TQByteArray a = d->ss->read(); #ifdef XMPP_DEBUG - QCString cs(a.data(), a.size()+1); + TQCString cs(a.data(), a.size()+1); fprintf(stderr, "ClientStream: recv: %d [%s]\n", a.size(), cs.data()); #endif @@ -1044,7 +1044,7 @@ void ClientStream::ss_bytesWritten(int bytes) void ClientStream::ss_tlsHandshaken() { - QGuardedPtr<QObject> self = this; + TQGuardedPtr<TQObject> self = this; securityLayerActivated(LayerTLS); if(!self) return; @@ -1070,17 +1070,17 @@ void ClientStream::ss_error(int x) } } -void ClientStream::sasl_clientFirstStep(const QString &mech, const QByteArray *stepData) +void ClientStream::sasl_clientFirstStep(const TQString &mech, const TQByteArray *stepData) { - d->client.setSASLFirst(mech, stepData ? *stepData : QByteArray()); + d->client.setSASLFirst(mech, stepData ? *stepData : TQByteArray()); //d->client.sasl_mech = mech; //d->client.sasl_firstStep = stepData ? true : false; - //d->client.sasl_step = stepData ? *stepData : QByteArray(); + //d->client.sasl_step = stepData ? *stepData : TQByteArray(); processNext(); } -void ClientStream::sasl_nextStep(const QByteArray &stepData) +void ClientStream::sasl_nextStep(const TQByteArray &stepData) { if(d->mode == Client) d->client.setSASLNext(stepData); @@ -1109,12 +1109,12 @@ void ClientStream::sasl_needParams(bool user, bool authzid, bool pass, bool real d->sasl->continueAfterParams(); } -void ClientStream::sasl_authCheck(const QString &user, const QString &) +void ClientStream::sasl_authCheck(const TQString &user, const TQString &) { //#ifdef XMPP_DEBUG // printf("authcheck: [%s], [%s]\n", user.latin1(), authzid.latin1()); //#endif - QString u = user; + TQString u = user; int n = u.find('@'); if(n != -1) u.truncate(n); @@ -1163,10 +1163,10 @@ void ClientStream::srvProcessNext() else if(need == CoreProtocol::NSASLMechs) { if(!d->sasl) { d->sasl = new QCA::SASL; - connect(d->sasl, SIGNAL(authCheck(const QString &, const QString &)), SLOT(sasl_authCheck(const QString &, const QString &))); - connect(d->sasl, SIGNAL(nextStep(const QByteArray &)), SLOT(sasl_nextStep(const QByteArray &))); - connect(d->sasl, SIGNAL(authenticated()), SLOT(sasl_authenticated())); - connect(d->sasl, SIGNAL(error(int)), SLOT(sasl_error(int))); + connect(d->sasl, TQT_SIGNAL(authCheck(const TQString &, const TQString &)), TQT_SLOT(sasl_authCheck(const TQString &, const TQString &))); + connect(d->sasl, TQT_SIGNAL(nextStep(const TQByteArray &)), TQT_SLOT(sasl_nextStep(const TQByteArray &))); + connect(d->sasl, TQT_SIGNAL(authenticated()), TQT_SLOT(sasl_authenticated())); + connect(d->sasl, TQT_SIGNAL(error(int)), TQT_SLOT(sasl_error(int))); //d->sasl->setAllowAnonymous(false); //d->sasl->setRequirePassCredentials(true); @@ -1175,7 +1175,7 @@ void ClientStream::srvProcessNext() d->sasl->setMinimumSSF(0); d->sasl->setMaximumSSF(256); - QStringList list; + TQStringList list; // TODO: d->server is probably wrong here if(!d->sasl->startServer("xmpp", d->server, d->defRealm, &list)) { printf("Error initializing SASL\n"); @@ -1193,18 +1193,18 @@ void ClientStream::srvProcessNext() // TODO return; } - QByteArray a = d->srv.spare; + TQByteArray a = d->srv.spare; d->ss->startTLSServer(d->tls, a); } else if(need == CoreProtocol::NSASLFirst) { printf("Need SASL First Step\n"); - QByteArray a = d->srv.saslStep(); + TQByteArray a = d->srv.saslStep(); d->sasl->putServerFirstStep(d->srv.saslMech(), a); } else if(need == CoreProtocol::NSASLNext) { printf("Need SASL Next Step\n"); - QByteArray a = d->srv.saslStep(); - QCString cs(a.data(), a.size()+1); + TQByteArray a = d->srv.saslStep(); + TQCString cs(a.data(), a.size()+1); printf("[%s]\n", cs.data()); d->sasl->putStep(a); } @@ -1230,8 +1230,8 @@ void ClientStream::srvProcessNext() return; } case CoreProtocol::ESend: { - QByteArray a = d->srv.takeOutgoingData(); - QCString cs(a.size()+1); + TQByteArray a = d->srv.takeOutgoingData(); + TQCString cs(a.size()+1); memcpy(cs.data(), a.data(), a.size()); printf("Need Send: {%s}\n", cs.data()); d->ss->write(a); @@ -1241,7 +1241,7 @@ void ClientStream::srvProcessNext() printf("Break (RecvOpen)\n"); // calculate key - QCString str = QCA::SHA1::hashToString("secret").utf8(); + TQCString str = QCA::SHA1::hashToString("secret").utf8(); str = QCA::SHA1::hashToString(str + "im.pyxa.org").utf8(); str = QCA::SHA1::hashToString(str + d->srv.id.utf8()).utf8(); d->srv.setDialbackKey(str); @@ -1258,8 +1258,8 @@ void ClientStream::srvProcessNext() } case CoreProtocol::ESASLSuccess: { printf("Break SASL Success\n"); - disconnect(d->sasl, SIGNAL(error(int)), this, SLOT(sasl_error(int))); - QByteArray a = d->srv.spare; + disconnect(d->sasl, TQT_SIGNAL(error(int)), this, TQT_SLOT(sasl_error(int))); + TQByteArray a = d->srv.spare; d->ss->setLayerSASL(d->sasl, a); break; } @@ -1276,7 +1276,7 @@ void ClientStream::srvProcessNext() void ClientStream::doReadyRead() { - //QGuardedPtr<QObject> self = this; + //TQGuardedPtr<TQObject> self = this; readyRead(); //if(!self) // return; @@ -1290,7 +1290,7 @@ void ClientStream::processNext() return; } - QGuardedPtr<QObject> self = this; + TQGuardedPtr<TQObject> self = this; while(1) { #ifdef XMPP_DEBUG @@ -1298,11 +1298,11 @@ void ClientStream::processNext() #endif bool ok = d->client.processStep(); // deal with send/received items - for(QValueList<XmlProtocol::TransferItem>::ConstIterator it = d->client.transferItemList.begin(); it != d->client.transferItemList.end(); ++it) { + for(TQValueList<XmlProtocol::TransferItem>::ConstIterator it = d->client.transferItemList.begin(); it != d->client.transferItemList.end(); ++it) { const XmlProtocol::TransferItem &i = *it; if(i.isExternal) continue; - QString str; + TQString str; if(i.isString) { // skip whitespace pings if(i.str.stripWhiteSpace().isEmpty()) @@ -1324,7 +1324,7 @@ void ClientStream::processNext() //if(!d->in_rrsig && !d->in.isEmpty()) { if(!d->in.isEmpty()) { //d->in_rrsig = true; - QTimer::singleShot(0, this, SLOT(doReadyRead())); + TQTimer::singleShot(0, this, TQT_SLOT(doReadyRead())); } if(cont) @@ -1343,9 +1343,9 @@ void ClientStream::processNext() return; } case CoreProtocol::ESend: { - QByteArray a = d->client.takeOutgoingData(); + TQByteArray a = d->client.takeOutgoingData(); #ifdef XMPP_DEBUG - QCString cs(a.size()+1); + TQCString cs(a.size()+1); memcpy(cs.data(), a.data(), a.size()); printf("Need Send: {%s}\n", cs.data()); #endif @@ -1358,9 +1358,9 @@ void ClientStream::processNext() #endif #ifdef XMPP_TEST - QString s = QString("handshake success (lang=[%1]").arg(d->client.lang); + TQString s = TQString("handshake success (lang=[%1]").arg(d->client.lang); if(!d->client.from.isEmpty()) - s += QString(", from=[%1]").arg(d->client.from); + s += TQString(", from=[%1]").arg(d->client.from); s += ')'; TD::msg(s); #endif @@ -1480,11 +1480,11 @@ bool ClientStream::handleNeed() } d->sasl = new QCA::SASL; - connect(d->sasl, SIGNAL(clientFirstStep(const QString &, const QByteArray *)), SLOT(sasl_clientFirstStep(const QString &, const QByteArray *))); - connect(d->sasl, SIGNAL(nextStep(const QByteArray &)), SLOT(sasl_nextStep(const QByteArray &))); - connect(d->sasl, SIGNAL(needParams(bool, bool, bool, bool)), SLOT(sasl_needParams(bool, bool, bool, bool))); - connect(d->sasl, SIGNAL(authenticated()), SLOT(sasl_authenticated())); - connect(d->sasl, SIGNAL(error(int)), SLOT(sasl_error(int))); + connect(d->sasl, TQT_SIGNAL(clientFirstStep(const TQString &, const TQByteArray *)), TQT_SLOT(sasl_clientFirstStep(const TQString &, const TQByteArray *))); + connect(d->sasl, TQT_SIGNAL(nextStep(const TQByteArray &)), TQT_SLOT(sasl_nextStep(const TQByteArray &))); + connect(d->sasl, TQT_SIGNAL(needParams(bool, bool, bool, bool)), TQT_SLOT(sasl_needParams(bool, bool, bool, bool))); + connect(d->sasl, TQT_SIGNAL(authenticated()), TQT_SLOT(sasl_authenticated())); + connect(d->sasl, TQT_SIGNAL(error(int)), TQT_SLOT(sasl_error(int))); if(d->haveLocalAddr) d->sasl->setLocalAddr(d->localAddr, d->localPort); @@ -1506,7 +1506,7 @@ bool ClientStream::handleNeed() d->sasl->setMinimumSSF(d->minimumSSF); d->sasl->setMaximumSSF(d->maximumSSF); - QStringList ml; + TQStringList ml; if(!d->sasl_mech.isEmpty()) ml += d->sasl_mech; else @@ -1525,16 +1525,16 @@ bool ClientStream::handleNeed() #ifdef XMPP_DEBUG printf("Need SASL Next Step\n"); #endif - QByteArray a = d->client.saslStep(); + TQByteArray a = d->client.saslStep(); d->sasl->putStep(a); return false; } case CoreProtocol::NSASLLayer: { // SecureStream will handle the errors from this point - disconnect(d->sasl, SIGNAL(error(int)), this, SLOT(sasl_error(int))); + disconnect(d->sasl, TQT_SIGNAL(error(int)), this, TQT_SLOT(sasl_error(int))); d->ss->setLayerSASL(d->sasl, d->client.spare); if(d->sasl_ssf > 0) { - QGuardedPtr<QObject> self = this; + TQGuardedPtr<TQObject> self = this; securityLayerActivated(LayerSASL); if(!self) return false; @@ -1580,7 +1580,7 @@ void ClientStream::doNoop() } } -void ClientStream::writeDirect(const QString &s) +void ClientStream::writeDirect(const TQString &s) { if(d->state == Active) { #ifdef XMPP_DEBUG @@ -1604,8 +1604,8 @@ void ClientStream::handleError() } else if(c == CoreProtocol::ErrStream) { int x = d->client.errCond; - QString text = d->client.errText; - QDomElement appSpec = d->client.errAppSpec; + TQString text = d->client.errText; + TQDomElement appSpec = d->client.errAppSpec; int connErr = -1; int strErr = -1; @@ -1730,31 +1730,31 @@ TD::~TD() { } -void TD::msg(const QString &s) +void TD::msg(const TQString &s) { if(debug_ptr) debug_ptr->msg(s); } -void TD::outgoingTag(const QString &s) +void TD::outgoingTag(const TQString &s) { if(debug_ptr) debug_ptr->outgoingTag(s); } -void TD::incomingTag(const QString &s) +void TD::incomingTag(const TQString &s) { if(debug_ptr) debug_ptr->incomingTag(s); } -void TD::outgoingXml(const QDomElement &e) +void TD::outgoingXml(const TQDomElement &e) { if(debug_ptr) debug_ptr->outgoingXml(e); } -void TD::incomingXml(const QDomElement &e) +void TD::incomingXml(const TQDomElement &e) { if(debug_ptr) debug_ptr->incomingXml(e); |