1 Index: cutestuff/legacy/ndns.cpp
2 ===================================================================
3 --- cutestuff/legacy/ndns.cpp (revision 355)
4 +++ cutestuff/legacy/ndns.cpp (working copy)
13 Index: cutestuff/network/bsocket.h
14 ===================================================================
15 --- cutestuff/network/bsocket.h (revision 355)
16 +++ cutestuff/network/bsocket.h (working copy)
21 +#include <cutestuff_export.h>
24 -class BSocket : public ByteStream
25 +class CUTESTUFF_EXPORT BSocket : public ByteStream
29 Index: cutestuff/network/httpconnect.h
30 ===================================================================
31 --- cutestuff/network/httpconnect.h (revision 355)
32 +++ cutestuff/network/httpconnect.h (working copy)
35 #include "bytestream.h"
37 +#include <cutestuff_export.h>
40 -class HttpConnect : public ByteStream
41 +class CUTESTUFF_EXPORT HttpConnect : public ByteStream
45 Index: cutestuff/network/httppoll.cpp
46 ===================================================================
47 --- cutestuff/network/httppoll.cpp (revision 355)
48 +++ cutestuff/network/httppoll.cpp (working copy)
53 - return QCA::Base64().arrayToString( QCA::SHA1().hash( Q3CString(hpk(n - 1, s).latin1()) ).toByteArray() );
54 + return QCA::Base64().arrayToString( QCA::Hash("sha1").hash( Q3CString(hpk(n - 1, s).latin1()) ).toByteArray() );
57 class HttpPoll::Private
58 Index: cutestuff/network/httppoll.h
59 ===================================================================
60 --- cutestuff/network/httppoll.h (revision 355)
61 +++ cutestuff/network/httppoll.h (working copy)
64 #include "bytestream.h"
66 +#include <cutestuff_export.h>
69 -class HttpPoll : public ByteStream
70 +class CUTESTUFF_EXPORT HttpPoll : public ByteStream
75 const QString & getKey(bool *);
78 -class HttpProxyPost : public QObject
79 +class CUTESTUFF_EXPORT HttpProxyPost : public QObject
83 Index: cutestuff/network/socks.cpp
84 ===================================================================
85 --- cutestuff/network/socks.cpp (revision 355)
86 +++ cutestuff/network/socks.cpp (working copy)
91 +#include <winsock2.h>
95 Index: cutestuff/network/socks.h
96 ===================================================================
97 --- cutestuff/network/socks.h (revision 355)
98 +++ cutestuff/network/socks.h (working copy)
101 #include "bytestream.h"
103 +#include <cutestuff_export.h>
104 // CS_NAMESPACE_BEGIN
110 -class SocksUDP : public QObject
111 +class CUTESTUFF_EXPORT SocksUDP : public QObject
116 SocksUDP(SocksClient *sc, const QString &host, int port, const QHostAddress &routeAddr, int routePort);
119 -class SocksClient : public ByteStream
120 +class CUTESTUFF_EXPORT SocksClient : public ByteStream
125 void writeData(const QByteArray &a);
128 -class SocksServer : public QObject
129 +class CUTESTUFF_EXPORT SocksServer : public QObject
133 Index: cutestuff/util/bytestream.h
134 ===================================================================
135 --- cutestuff/util/bytestream.h (revision 355)
136 +++ cutestuff/util/bytestream.h (working copy)
139 #include <q3cstring.h>
141 +#include <cutestuff_export.h>
142 // CS_NAMESPACE_BEGIN
145 -class ByteStream : public QObject
146 +class CUTESTUFF_EXPORT ByteStream : public QObject
150 Index: iris/include/im.h
151 ===================================================================
152 --- iris/include/im.h (revision 355)
153 +++ iris/include/im.h (working copy)
155 #include "xmpp_rosterx.h"
156 #include "xmpp_xdata.h"
158 +#include <iris_export.h>
160 +#ifdef IRIS_FULL_TEMPLATE_EXPORT_INSTANTIATION
161 +# define IRIS_DUMMY_COMPARISON_OPERATOR(C) \
162 + bool operator==(const C&) const { \
163 + qWarning(#C"::operator==(const "#C"&) was called"); \
166 +# define IRIS_DUMMY_QHASH_FUNCTION(C) \
167 + inline uint qHash(const C) { \
168 + qWarning("inline uint qHash(const "#C") was called"); \
172 +# define IRIS_DUMMY_COMPARISON_OPERATOR(C)
173 +# define IRIS_DUMMY_QHASH_FUNCTION(C)
179 + class IRIS_EXPORT Url
182 Url(const QString &url="", const QString &desc="");
184 typedef QList<Address> AddressList;
185 typedef QMap<QString, QString> StringMap;
186 typedef enum { OfflineEvent, DeliveredEvent, DisplayedEvent,
187 - ComposingEvent, CancelEvent } MsgEvent;
188 + ComposingEvent, CancelEvent, InactiveEvent, GoneEvent } MsgEvent;
189 typedef enum { StateNone, StateActive, StateComposing, StatePaused,
190 StateInactive, StateGone } ChatState;
193 QDomElement payload_;
197 + class IRIS_EXPORT HTMLElement
206 + class IRIS_EXPORT Message
209 Message(const Jid &to="");
215 + class IRIS_EXPORT Subscription
218 enum SubType { None, To, From, Both, Remove };
224 + class IRIS_EXPORT Resource
227 Resource(const QString &name="", const Status &s=Status());
228 @@ -296,12 +314,14 @@
229 void setName(const QString &);
230 void setStatus(const Status &);
232 + IRIS_DUMMY_COMPARISON_OPERATOR(Resource)
237 + IRIS_DUMMY_QHASH_FUNCTION(Resource)
239 - class ResourceList : public QList<Resource>
240 + class IRIS_EXPORT ResourceList : public QList<Resource>
245 ResourceList::ConstIterator priority() const;
249 + class IRIS_EXPORT RosterItem
252 RosterItem(const Jid &jid="");
254 QDomElement toXml(QDomDocument *) const;
255 bool fromXml(const QDomElement &);
257 + IRIS_DUMMY_COMPARISON_OPERATOR(RosterItem)
265 + IRIS_DUMMY_QHASH_FUNCTION(RosterItem)
267 - class Roster : public QList<RosterItem>
268 + class IRIS_EXPORT Roster : public QList<RosterItem>
273 class RosterPrivate *d;
277 + class IRIS_EXPORT AgentItem
283 typedef QList<AgentItem> AgentList;
286 + class IRIS_EXPORT DiscoItem
292 typedef QList<DiscoItem> DiscoList;
295 + class IRIS_EXPORT FormField
298 enum { username, nick, password, name, first, last, email, address, city, state, zip, phone, url, date, misc };
300 bool setType(const QString &);
301 void setValue(const QString &);
303 + IRIS_DUMMY_COMPARISON_OPERATOR(FormField)
306 int tagNameToType(const QString &) const;
307 QString typeToTagName(int) const;
312 + IRIS_DUMMY_QHASH_FUNCTION(FormField)
314 - class Form : public QList<FormField>
315 + class IRIS_EXPORT Form : public QList<FormField>
318 Form(const Jid &j="");
324 + class IRIS_EXPORT SearchResult
327 SearchResult(const Jid &jid="");
329 class JidLinkManager;
330 class FileTransferManager;
332 - class Client : public QObject
333 + class IRIS_EXPORT Client : public QObject
341 - class LiveRosterItem : public RosterItem
342 + class IRIS_EXPORT LiveRosterItem : public RosterItem
345 LiveRosterItem(const Jid &j="");
347 bool v_flagForDelete;
350 - class LiveRoster : public QList<LiveRosterItem>
351 + class IRIS_EXPORT LiveRoster : public QList<LiveRosterItem>
355 Index: iris/include/xmpp.h
356 ===================================================================
357 --- iris/include/xmpp.h (revision 355)
358 +++ iris/include/xmpp.h (working copy)
361 #include "xmpp_jid.h"
363 +#include <iris_export.h>
375 void setDebug(Debug *);
377 - class Connector : public QObject
378 + class IRIS_EXPORT Connector : public QObject
386 - class AdvancedConnector : public Connector
387 + class IRIS_EXPORT AdvancedConnector : public Connector
395 - class TLSHandler : public QObject
396 + class IRIS_EXPORT TLSHandler : public QObject
401 void readyReadOutgoing(const QByteArray &a, int plainBytes);
404 - class QCATLSHandler : public TLSHandler
405 + class IRIS_EXPORT QCATLSHandler : public TLSHandler
414 + class IRIS_EXPORT Stanza
417 enum Kind { Message, Presence, IQ };
422 - class Stream : public QObject
423 + class IRIS_EXPORT Stream : public QObject
431 - class ClientStream : public Stream
432 + class IRIS_EXPORT ClientStream : public Stream
438 void srvProcessNext();
444 Index: iris/include/xmpp_features.h
445 ===================================================================
446 --- iris/include/xmpp_features.h (revision 355)
447 +++ iris/include/xmpp_features.h (working copy)
449 #include <QStringList>
452 +#include <iris_export.h>
457 + class IRIS_EXPORT Features
462 bool canDisco() const;
463 bool canChatState() const;
464 bool canCommand() const;
465 + bool canXHTML() const;
466 bool isGateway() const;
467 bool haveVCard() const;
475 // private Psi actions
477 Index: iris/include/xmpp_jid.h
478 ===================================================================
479 --- iris/include/xmpp_jid.h (revision 355)
480 +++ iris/include/xmpp_jid.h (working copy)
485 +#include <iris_export.h>
490 + class IRIS_EXPORT Jid
494 Index: iris/include/xmpp_status.h
495 ===================================================================
496 --- iris/include/xmpp_status.h (revision 355)
497 +++ iris/include/xmpp_status.h (working copy)
500 #include "xmpp_muc.h"
502 +#include <iris_export.h>
507 + class IRIS_EXPORT Status
510 enum Type { Offline, Online, Away, XA, DND, Invisible, FFC };
511 Index: iris/include/xmpp_task.h
512 ===================================================================
513 --- iris/include/xmpp_task.h (revision 355)
514 +++ iris/include/xmpp_task.h (working copy)
519 +#include <iris_export.h>
528 - class Task : public QObject
529 + class IRIS_EXPORT Task : public QObject
533 Index: iris/include/xmpp_xdata.h
534 ===================================================================
535 --- iris/include/xmpp_xdata.h (revision 355)
536 +++ iris/include/xmpp_xdata.h (working copy)
538 QSharedDataPointer<Private> d;
545 Index: iris/jabber/filetransfer.cpp
546 ===================================================================
547 --- iris/jabber/filetransfer.cpp (revision 355)
548 +++ iris/jabber/filetransfer.cpp (working copy)
555 qlonglong rangeOffset, rangeLength, length;
557 @@ -104,13 +105,14 @@
561 -void FileTransfer::sendFile(const Jid &to, const QString &fname, qlonglong size, const QString &desc)
562 +void FileTransfer::sendFile(const Jid &to, const QString &fname, qlonglong size, const QString &desc, const QString& preview)
564 d->state = Requesting;
569 + d->preview = preview;
571 d->id = d->m->link(this);
574 connect(d->ft, SIGNAL(finished()), SLOT(ft_finished()));
576 list += "http://jabber.org/protocol/bytestreams";
577 - d->ft->request(to, d->id, fname, size, desc, list);
578 + d->ft->request(to, d->id, fname, size, desc, list,preview);
587 +QString XMPP::FileTransfer::preview() const
592 bool FileTransfer::rangeSupported() const
594 return d->rangeSupported;
596 d->fname = req.fname;
599 + d->preview = req.preview;
600 d->rangeSupported = req.rangeSupported;
607 -void JT_FT::request(const Jid &to, const QString &_id, const QString &fname, qlonglong size, const QString &desc, const QStringList &streamTypes)
608 +void JT_FT::request(const Jid &to, const QString &_id, const QString &fname, qlonglong size, const QString &desc, const QStringList &streamTypes, const QString& preview)
613 de.appendChild(doc()->createTextNode(desc));
614 file.appendChild(de);
616 + if(!preview.isEmpty()) {
617 + QDomElement pr = doc()->createElement("preview");
618 + pr.setAttribute("xmlns", "http://kopete.kde.org/protocol/file-preview");
619 + pr.appendChild(doc()->createTextNode(preview));
620 + file.appendChild(pr);
622 QDomElement range = doc()->createElement("range");
623 file.appendChild(range);
624 si.appendChild(file);
626 QDomElement de = file.elementsByTagName("desc").item(0).toElement();
631 + QDomElement pr = file.elementsByTagName("preview").item(0).toElement();
633 + preview= pr.text();
635 bool rangeSupported = false;
636 QDomElement range = file.elementsByTagName("range").item(0).toElement();
641 + r.preview = preview;
642 r.rangeSupported = rangeSupported;
643 r.streamTypes = streamTypes;
645 Index: iris/jabber/filetransfer.h
646 ===================================================================
647 --- iris/jabber/filetransfer.h (revision 355)
648 +++ iris/jabber/filetransfer.h (working copy)
650 virtual void accept(qlonglong offset=0, qlonglong length=0) = 0;
653 - class FileTransfer : public QObject /*, public AbstractFileTransfer */
654 + class IRIS_EXPORT FileTransfer : public QObject /*, public AbstractFileTransfer */
659 void setProxy(const Jid &proxy);
662 - void sendFile(const Jid &to, const QString &fname, qlonglong size, const QString &desc);
663 + void sendFile(const Jid &to, const QString &fname, qlonglong size, const QString &desc, const QString& preview=QString());
664 qlonglong offset() const;
665 qlonglong length() const;
666 int dataSizeNeeded() const;
668 QString fileName() const;
669 qlonglong fileSize() const;
670 QString description() const;
671 + QString preview() const;
672 bool rangeSupported() const;
673 void accept(qlonglong offset=0, qlonglong length=0);
676 void takeConnection(S5BConnection *c);
679 - class FileTransferManager : public QObject
680 + class IRIS_EXPORT FileTransferManager : public QObject
684 @@ -128,14 +129,14 @@
685 void unlink(FileTransfer *);
688 - class JT_FT : public Task
689 + class IRIS_EXPORT JT_FT : public Task
696 - void request(const Jid &to, const QString &id, const QString &fname, qlonglong size, const QString &desc, const QStringList &streamTypes);
697 + void request(const Jid &to, const QString &id, const QString &fname, qlonglong size, const QString &desc, const QStringList &streamTypes, const QString &preview=QString());
698 qlonglong rangeOffset() const;
699 qlonglong rangeLength() const;
700 QString streamType() const;
707 QStringList streamTypes;
709 Index: iris/jabber/s5b.cpp
710 ===================================================================
711 --- iris/jabber/s5b.cpp (revision 355)
712 +++ iris/jabber/s5b.cpp (working copy)
716 # include <windows.h>
717 +# include <winsock2.h>
719 # include <netinet/in.h>
722 static QString makeKey(const QString &sid, const Jid &initiator, const Jid &target)
724 QString str = sid + initiator.full() + target.full();
725 - return QCA::SHA1().hashToString(str.utf8());
726 + return QCA::Hash("sha1").hashToString(str.utf8());
729 static bool haveHost(const StreamHostList &list, const Jid &j)
730 Index: iris/jabber/s5b.h
731 ===================================================================
732 --- iris/jabber/s5b.h (revision 355)
733 +++ iris/jabber/s5b.h (working copy)
735 typedef Q3PtrList<S5BConnection> S5BConnectionList;
736 typedef Q3PtrListIterator<S5BConnection> S5BConnectionListIt;
739 + class IRIS_EXPORT S5BDatagram
747 - class S5BConnection : public ByteStream
748 + class IRIS_EXPORT S5BConnection : public ByteStream
753 S5BConnection(S5BManager *, QObject *parent=0);
756 - class S5BManager : public QObject
757 + class IRIS_EXPORT S5BManager : public QObject
762 void doActivate(const Jid &peer, const QString &sid, const Jid &streamHost);
765 - class S5BConnector : public QObject
766 + class IRIS_EXPORT S5BConnector : public QObject
773 // listens on a port for serving
774 - class S5BServer : public QObject
775 + class IRIS_EXPORT S5BServer : public QObject
780 void writeUDP(const QHostAddress &addr, int port, const QByteArray &data);
783 - class JT_S5B : public Task
784 + class IRIS_EXPORT JT_S5B : public Task
793 + struct IRIS_EXPORT S5BRequest
801 - class JT_PushS5B : public Task
802 + class IRIS_EXPORT JT_PushS5B : public Task
807 void incomingActivate(const Jid &from, const QString &sid, const Jid &streamHost);
811 + class IRIS_EXPORT StreamHost
815 Index: iris/jabber/xmpp_ibb.h
816 ===================================================================
817 --- iris/jabber/xmpp_ibb.h (revision 355)
818 +++ iris/jabber/xmpp_ibb.h (working copy)
822 // this is an IBB connection. use it much like a qsocket
823 - class IBBConnection : public ByteStream
824 + class IRIS_EXPORT IBBConnection : public ByteStream
830 typedef Q3PtrList<IBBConnection> IBBConnectionList;
831 typedef Q3PtrListIterator<IBBConnection> IBBConnectionListIt;
832 - class IBBManager : public QObject
833 + class IRIS_EXPORT IBBManager : public QObject
838 void doReject(IBBConnection *c, const QString &id, int, const QString &);
841 - class JT_IBB : public Task
842 + class IRIS_EXPORT JT_IBB : public Task
846 Index: iris/xmpp-core/compress.cpp
847 ===================================================================
848 --- iris/xmpp-core/compress.cpp (revision 355)
849 +++ iris/xmpp-core/compress.cpp (working copy)
856 #include "compress.h"
858 Index: iris/xmpp-core/jid.cpp
859 ===================================================================
860 --- iris/xmpp-core/jid.cpp (revision 355)
861 +++ iris/xmpp-core/jid.cpp (working copy)
867 + b=b.toLower(); // JID are not case sensitive
872 Index: iris/xmpp-core/parser.cpp
873 ===================================================================
874 --- iris/xmpp-core/parser.cpp (revision 355)
875 +++ iris/xmpp-core/parser.cpp (working copy)
877 Q3PtrList<Parser::Event> eventList;
884 //----------------------------------------------------------------------------
885 Index: iris/xmpp-core/protocol.cpp
886 ===================================================================
887 --- iris/xmpp-core/protocol.cpp (revision 355)
888 +++ iris/xmpp-core/protocol.cpp (working copy)
889 @@ -1227,7 +1227,7 @@
891 p = doc.createElement("digest");
892 Q3CString cs = id.utf8() + password.utf8();
893 - p.appendChild(doc.createTextNode(QCA::SHA1().hashToString(cs)));
894 + p.appendChild(doc.createTextNode(QCA::Hash("sha1").hashToString(cs)));
897 p = doc.createElement("password");
898 Index: iris/xmpp-core/protocol.h
899 ===================================================================
900 --- iris/xmpp-core/protocol.h (revision 355)
901 +++ iris/xmpp-core/protocol.h (working copy)
903 #define NS_SESSION "urn:ietf:params:xml:ns:xmpp-session"
904 #define NS_STANZAS "urn:ietf:params:xml:ns:xmpp-stanzas"
905 #define NS_BIND "urn:ietf:params:xml:ns:xmpp-bind"
906 +#define NS_CHATSTATES "http://jabber.org/protocol/chatstates"
907 #define NS_COMPRESS_FEATURE "http://jabber.org/features/compress"
908 #define NS_COMPRESS_PROTOCOL "http://jabber.org/protocol/compress"
910 Index: iris/xmpp-core/simplesasl.cpp
911 ===================================================================
912 --- iris/xmpp-core/simplesasl.cpp (revision 355)
913 +++ iris/xmpp-core/simplesasl.cpp (working copy)
917 Q3CString X = user.utf8() + ':' + realm.utf8() + ':' + Q3CString(pass.toByteArray());
918 - QByteArray Y = QCA::MD5().hash(X).toByteArray();
919 + QByteArray Y = QCA::Hash("md5").hash(X).toByteArray();
920 QByteArray tmp = ':' + nonce + ':' + cnonce;
921 if (!authz.isEmpty())
922 tmp += ':' + authz.utf8();
923 @@ -357,10 +357,10 @@
925 QByteArray A1(Y + tmp);
926 QByteArray A2 = QByteArray("AUTHENTICATE:") + uri;
927 - Q3CString HA1 = QCA::MD5().hashToString(A1).latin1();
928 - Q3CString HA2 = QCA::MD5().hashToString(A2).latin1();
929 + Q3CString HA1 = QCA::Hash("md5").hashToString(A1).latin1();
930 + Q3CString HA2 = QCA::Hash("md5").hashToString(A2).latin1();
931 Q3CString KD = HA1 + ':' + nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + HA2;
932 - Q3CString Z = QCA::MD5().hashToString(KD).latin1();
933 + Q3CString Z = QCA::Hash("md5").hashToString(KD).latin1();
935 //qDebug(QString("simplesasl.cpp: A1 = %1").arg(QString(A1)).toAscii());
936 //qDebug(QString("simplesasl.cpp: A2 = %1").arg(QString(A2)).toAscii());
941 + int version() const {
942 + return QCA_VERSION;
945 QString name() const {
948 Index: iris/xmpp-core/stream.cpp
949 ===================================================================
950 --- iris/xmpp-core/stream.cpp (revision 355)
951 +++ iris/xmpp-core/stream.cpp (working copy)
953 //if(!QCA::isSupported(QCA::CAP_SHA1))
954 // QCA::insertProvider(createProviderHash());
956 - return QCA::SHA1().hashToString(randomArray(128));
957 + return QCA::Hash("sha1").hashToString(randomArray(128));
960 //----------------------------------------------------------------------------
961 @@ -1470,9 +1470,9 @@
962 printf("Break (RecvOpen)\n");
965 - Q3CString str = QCA::SHA1().hashToString("secret").utf8();
966 - str = QCA::SHA1().hashToString(str + "im.pyxa.org").utf8();
967 - str = QCA::SHA1().hashToString(str + d->srv.id.utf8()).utf8();
968 + Q3CString str = QCA::Hash("sha1").hashToString("secret").utf8();
969 + str = QCA::Hash("sha1").hashToString(str + "im.pyxa.org").utf8();
970 + str = QCA::Hash("sha1").hashToString(str + d->srv.id.utf8()).utf8();
971 d->srv.setDialbackKey(str);
973 //d->srv.setDialbackKey("3c5d721ea2fcc45b163a11420e4e358f87e3142a");
974 Index: iris/xmpp-im/types.cpp
975 ===================================================================
976 --- iris/xmpp-im/types.cpp (revision 355)
977 +++ iris/xmpp-im/types.cpp (working copy)
979 #include <qapplication.h>
982 +#include "protocol.h"
984 #define NS_XML "http://www.w3.org/XML/1998/namespace"
986 @@ -1515,28 +1516,48 @@
988 x.appendChild(s.createTextElement("jabber:x:event","id",d->eventId));
990 + else if (d->type=="chat" || d->type=="groupchat")
991 + s.appendChild( s.createElement(NS_CHATSTATES , "active" ) );
993 + bool need_x_event=false;
994 for(QList<MsgEvent>::ConstIterator ev = d->eventList.begin(); ev != d->eventList.end(); ++ev) {
997 x.appendChild(s.createElement("jabber:x:event", "offline"));
1000 case DeliveredEvent:
1001 x.appendChild(s.createElement("jabber:x:event", "delivered"));
1002 + need_x_event=true;
1004 case DisplayedEvent:
1005 x.appendChild(s.createElement("jabber:x:event", "displayed"));
1006 + need_x_event=true;
1008 case ComposingEvent:
1009 x.appendChild(s.createElement("jabber:x:event", "composing"));
1010 + need_x_event=true;
1011 + if (d->body.isEmpty() && (d->type=="chat" || d->type=="groupchat") )
1012 + s.appendChild( s.createElement(NS_CHATSTATES , "composing" ) );
1016 + need_x_event=true;
1017 + if (d->body.isEmpty() && (d->type=="chat" || d->type=="groupchat") )
1018 + s.appendChild( s.createElement(NS_CHATSTATES , "paused" ) );
1024 + case InactiveEvent:
1025 + if (d->body.isEmpty() && (d->type=="chat" || d->type=="groupchat") )
1026 + s.appendChild( s.createElement(NS_CHATSTATES , "inactive" ) );
1029 + if (d->body.isEmpty() && (d->type=="chat" || d->type=="groupchat") )
1030 + s.appendChild( s.createElement(NS_CHATSTATES , "gone" ) );
1034 + if(need_x_event) //we don't need to have the (empty) x:event element if this is only <gone> or <inactive>
1039 QString chatStateNS = "http://jabber.org/protocol/chatstates";
1040 @@ -1647,6 +1668,7 @@
1042 d->htmlElements.clear();
1043 d->thread = QString();
1044 + d->eventList.clear();
1046 QDomElement root = s.element();
1048 @@ -1687,6 +1709,33 @@
1052 + else if (e.namespaceURI() == NS_CHATSTATES)
1054 + if(e.tagName() == "active")
1056 + //like in JEP-0022 we let the client know that we can receive ComposingEvent
1057 + // (we can do that according to \04.6 of the JEP-0085)
1058 + d->eventList += ComposingEvent;
1059 + d->eventList += InactiveEvent;
1060 + d->eventList += GoneEvent;
1062 + else if (e.tagName() == "composing")
1064 + d->eventList += ComposingEvent;
1066 + else if (e.tagName() == "paused")
1068 + d->eventList += CancelEvent;
1070 + else if (e.tagName() == "inactive")
1072 + d->eventList += InactiveEvent;
1074 + else if (e.tagName() == "gone")
1076 + d->eventList += GoneEvent;
1080 //printf("extension element: [%s]\n", e.tagName().latin1());
1082 @@ -1733,7 +1782,6 @@
1086 - d->eventList.clear();
1087 nl = root.elementsByTagNameNS("jabber:x:event", "x");
1089 nl = nl.item(0).childNodes();
1090 @@ -1748,6 +1796,8 @@
1091 d->eventList += ComposingEvent;
1092 else if (evtag == "delivered")
1093 d->eventList += DeliveredEvent;
1094 + else if (evtag == "offline")
1095 + d->eventList += OfflineEvent;
1097 if (d->eventList.isEmpty())
1098 d->eventList += CancelEvent;
1099 @@ -3040,6 +3090,14 @@
1103 +#define FID_XHTML "http://jabber.org/protocol/xhtml-im"
1104 +bool Features::canXHTML() const
1111 #define FID_GATEWAY "jabber:iq:gateway"
1112 bool Features::isGateway() const
1114 Index: iris/xmpp-im/xmpp_tasks.cpp
1115 ===================================================================
1116 --- iris/xmpp-im/xmpp_tasks.cpp (revision 355)
1117 +++ iris/xmpp-im/xmpp_tasks.cpp (working copy)
1118 @@ -857,6 +857,74 @@
1121 //----------------------------------------------------------------------------
1122 +// JT_GetLastActivity
1123 +//----------------------------------------------------------------------------
1124 +class JT_GetLastActivity::Private
1133 +JT_GetLastActivity::JT_GetLastActivity(Task *parent)
1139 +JT_GetLastActivity::~JT_GetLastActivity()
1144 +void JT_GetLastActivity::get(const Jid &j)
1147 + iq = createIQ(doc(), "get", jid.full(), id());
1148 + QDomElement query = doc()->createElement("query");
1149 + query.setAttribute("xmlns", "jabber:iq:last");
1150 + iq.appendChild(query);
1153 +int JT_GetLastActivity::seconds() const
1155 + return d->seconds;
1158 +const QString &JT_GetLastActivity::message() const
1160 + return d->message;
1163 +void JT_GetLastActivity::onGo()
1168 +bool JT_GetLastActivity::take(const QDomElement &x)
1170 + if(!iqVerify(x, jid, id()))
1173 + if(x.attribute("type") == "result") {
1174 + QDomElement q = queryTag(x);
1176 + d->message = q.text();
1178 + d->seconds = q.attribute("seconds").toInt(&ok);
1189 +//----------------------------------------------------------------------------
1191 //----------------------------------------------------------------------------
1192 JT_GetServices::JT_GetServices(Task *parent)
1193 @@ -1408,6 +1476,10 @@
1194 query.appendChild(feature);
1197 + feature = doc()->createElement("feature");
1198 + feature.setAttribute("var", "http://jabber.org/protocol/xhtml-im");
1199 + query.appendChild(feature);
1201 if (node.isEmpty()) {
1202 // Extended features
1203 QStringList exts = client()->extensions();
1204 @@ -1982,3 +2054,93 @@
1211 +//----------------------------------------------------------------------------
1212 +// JT_PrivateStorage
1213 +//----------------------------------------------------------------------------
1214 +class JT_PrivateStorage::Private
1217 + Private() : type(-1) {}
1224 +JT_PrivateStorage::JT_PrivateStorage(Task *parent)
1230 +JT_PrivateStorage::~JT_PrivateStorage()
1235 +void JT_PrivateStorage::get(const QString& tag, const QString& xmlns)
1238 + d->iq = createIQ(doc(), "get" , QString() , id() );
1239 + QDomElement query = doc()->createElement("query");
1240 + query.setAttribute("xmlns", "jabber:iq:private");
1241 + d->iq.appendChild(query);
1242 + QDomElement s = doc()->createElement(tag);
1243 + if(!xmlns.isEmpty())
1244 + s.setAttribute("xmlns", xmlns);
1245 + query.appendChild(s);
1248 +void JT_PrivateStorage::set(const QDomElement& element)
1252 + QDomNode n=doc()->importNode(element,true);
1254 + d->iq = createIQ(doc(), "set" , QString() , id() );
1255 + QDomElement query = doc()->createElement("query");
1256 + query.setAttribute("xmlns", "jabber:iq:private");
1257 + d->iq.appendChild(query);
1258 + query.appendChild(n);
1261 +void JT_PrivateStorage::onGo()
1266 +bool JT_PrivateStorage::take(const QDomElement &x)
1268 + QString to = client()->host();
1269 + if(!iqVerify(x, to, id()))
1272 + if(x.attribute("type") == "result") {
1273 + if(d->type == 0) {
1274 + QDomElement q = queryTag(x);
1275 + for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) {
1276 + QDomElement i = n.toElement();
1294 +QDomElement JT_PrivateStorage::element( )
1298 Index: iris/xmpp-im/xmpp_tasks.h
1299 ===================================================================
1300 --- iris/xmpp-im/xmpp_tasks.h (revision 355)
1301 +++ iris/xmpp-im/xmpp_tasks.h (working copy)
1306 - class JT_Register : public Task
1307 + class IRIS_EXPORT JT_Register : public Task
1315 - class JT_UnRegister : public Task
1316 + class IRIS_EXPORT JT_UnRegister : public Task
1324 - class JT_Roster : public Task
1325 + class IRIS_EXPORT JT_Roster : public Task
1333 - class JT_PushRoster : public Task
1334 + class IRIS_EXPORT JT_PushRoster : public Task
1342 - class JT_Presence : public Task
1343 + class IRIS_EXPORT JT_Presence : public Task
1351 - class JT_PushPresence : public Task
1352 + class IRIS_EXPORT JT_PushPresence : public Task
1357 bool take(const QDomElement&);
1360 - class JT_Message : public Task
1361 + class IRIS_EXPORT JT_Message : public Task
1369 - class JT_PushMessage : public Task
1370 + class IRIS_EXPORT JT_PushMessage : public Task
1374 @@ -210,10 +210,33 @@
1378 - class JT_GetServices : public Task
1379 + class IRIS_EXPORT JT_GetLastActivity : public Task
1383 + JT_GetLastActivity(Task *);
1384 + ~JT_GetLastActivity();
1386 + void get(const Jid &);
1388 + int seconds() const;
1389 + const QString &message() const;
1392 + bool take(const QDomElement &x);
1402 + class IRIS_EXPORT JT_GetServices : public Task
1406 JT_GetServices(Task *);
1408 void get(const Jid &);
1410 AgentList agentList;
1413 - class JT_VCard : public Task
1414 + class IRIS_EXPORT JT_VCard : public Task
1422 - class JT_Search : public Task
1423 + class IRIS_EXPORT JT_Search : public Task
1431 - class JT_ClientVersion : public Task
1432 + class IRIS_EXPORT JT_ClientVersion : public Task
1440 - class JT_ServInfo : public Task
1441 + class IRIS_EXPORT JT_ServInfo : public Task
1446 bool take(const QDomElement &);
1449 - class JT_Gateway : public Task
1450 + class IRIS_EXPORT JT_Gateway : public Task
1455 QString v_prompt, v_desc;
1458 - class JT_Browse : public Task
1459 + class IRIS_EXPORT JT_Browse : public Task
1464 AgentItem browseHelper (const QDomElement &i);
1467 - class JT_DiscoItems : public Task
1468 + class IRIS_EXPORT JT_DiscoItems : public Task
1476 - class JT_DiscoInfo : public Task
1477 + class IRIS_EXPORT JT_DiscoInfo : public Task
1485 - class JT_DiscoPublish : public Task
1486 + class IRIS_EXPORT JT_DiscoPublish : public Task
1490 @@ -431,6 +454,27 @@
1495 + class IRIS_EXPORT JT_PrivateStorage : public Task
1499 + JT_PrivateStorage(Task *parent);
1500 + ~JT_PrivateStorage();
1502 + void set(const QDomElement &);
1503 + void get(const QString &tag, const QString& xmlns);
1505 + QDomElement element();
1508 + bool take(const QDomElement &);
1518 Index: iris/xmpp-im/xmpp_vcard.h
1519 ===================================================================
1520 --- iris/xmpp-im/xmpp_vcard.h (revision 355)
1521 +++ iris/xmpp-im/xmpp_vcard.h (working copy)
1526 +#include <iris_export.h>
1528 +// timezone() conflicts with a define/whatever deep inside win-sdk headers
1538 + class IRIS_EXPORT VCard
1543 void setBdayStr(const QString &);
1547 + class IRIS_EXPORT Address {
1552 const AddressList &addressList() const;
1553 void setAddressList(const AddressList &);
1556 + class IRIS_EXPORT Label {
1561 void setLabelList(const LabelList &);
1565 + class IRIS_EXPORT Phone {
1570 void setPhoneList(const PhoneList &);
1574 + class IRIS_EXPORT Email {
1579 void setTimezone(const QString &);
1583 + class IRIS_EXPORT Geo {
1588 void setAgentURI(const QString &);
1592 + class IRIS_EXPORT Org {
1596 Index: iris/xmpp-im/xmpp_xmlcommon.cpp
1597 ===================================================================
1598 --- iris/xmpp-im/xmpp_xmlcommon.cpp (revision 355)
1599 +++ iris/xmpp-im/xmpp_xmlcommon.cpp (working copy)
1607 Index: iris/xmpp-im/xmpp_xmlcommon.h
1608 ===================================================================
1609 --- iris/xmpp-im/xmpp_xmlcommon.h (revision 355)
1610 +++ iris/xmpp-im/xmpp_xmlcommon.h (working copy)
1612 void readBoolAttribute(QDomElement e, const QString &name, bool *v);
1614 //QString tagContent(const QDomElement &e); // obsolete;