The kde compile patch should be applied first
[kdenetwork.git] / kopete / protocols / jabber / libiris / iris_patch_070301.diff
bloba98366c250f263bc0951898db0cfcfadddab2254
1 Index: cutestuff/legacy/ndns.cpp
2 ===================================================================
3 --- cutestuff/legacy/ndns.cpp (revision 355)
4 +++ cutestuff/legacy/ndns.cpp (working copy)
5 @@ -68,6 +68,7 @@
7 #ifdef Q_OS_WIN32
8 #include <windows.h>
9 +#include <winsock2.h>
10 #endif
12 // CS_NAMESPACE_BEGIN
13 Index: cutestuff/network/bsocket.h
14 ===================================================================
15 --- cutestuff/network/bsocket.h (revision 355)
16 +++ cutestuff/network/bsocket.h (working copy)
17 @@ -29,9 +29,10 @@
18 class QObject;
19 class QByteArray;
21 +#include <cutestuff_export.h>
22 // CS_NAMESPACE_BEGIN
24 -class BSocket : public ByteStream
25 +class CUTESTUFF_EXPORT BSocket : public ByteStream
27 Q_OBJECT
28 public:
29 Index: cutestuff/network/httpconnect.h
30 ===================================================================
31 --- cutestuff/network/httpconnect.h (revision 355)
32 +++ cutestuff/network/httpconnect.h (working copy)
33 @@ -23,9 +23,10 @@
35 #include "bytestream.h"
37 +#include <cutestuff_export.h>
38 // CS_NAMESPACE_BEGIN
40 -class HttpConnect : public ByteStream
41 +class CUTESTUFF_EXPORT HttpConnect : public ByteStream
43 Q_OBJECT
44 public:
45 Index: cutestuff/network/httppoll.cpp
46 ===================================================================
47 --- cutestuff/network/httppoll.cpp (revision 355)
48 +++ cutestuff/network/httppoll.cpp (working copy)
49 @@ -54,7 +54,7 @@
50 if(n == 0)
51 return s;
52 else
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)
62 @@ -23,9 +23,10 @@
64 #include "bytestream.h"
66 +#include <cutestuff_export.h>
67 // CS_NAMESPACE_BEGIN
69 -class HttpPoll : public ByteStream
70 +class CUTESTUFF_EXPORT HttpPoll : public ByteStream
72 Q_OBJECT
73 public:
74 @@ -67,7 +68,7 @@
75 const QString & getKey(bool *);
78 -class HttpProxyPost : public QObject
79 +class CUTESTUFF_EXPORT HttpProxyPost : public QObject
81 Q_OBJECT
82 public:
83 Index: cutestuff/network/socks.cpp
84 ===================================================================
85 --- cutestuff/network/socks.cpp (revision 355)
86 +++ cutestuff/network/socks.cpp (working copy)
87 @@ -37,6 +37,7 @@
89 #ifdef Q_OS_WIN32
90 #include <windows.h>
91 +#include <winsock2.h>
92 #endif
94 #include "servsock.h"
95 Index: cutestuff/network/socks.h
96 ===================================================================
97 --- cutestuff/network/socks.h (revision 355)
98 +++ cutestuff/network/socks.h (working copy)
99 @@ -23,13 +23,14 @@
101 #include "bytestream.h"
103 +#include <cutestuff_export.h>
104 // CS_NAMESPACE_BEGIN
106 class QHostAddress;
107 class SocksClient;
108 class SocksServer;
110 -class SocksUDP : public QObject
111 +class CUTESTUFF_EXPORT SocksUDP : public QObject
113 Q_OBJECT
114 public:
115 @@ -52,7 +53,7 @@
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
122 Q_OBJECT
123 public:
124 @@ -125,7 +126,7 @@
125 void writeData(const QByteArray &a);
128 -class SocksServer : public QObject
129 +class CUTESTUFF_EXPORT SocksServer : public QObject
131 Q_OBJECT
132 public:
133 Index: cutestuff/util/bytestream.h
134 ===================================================================
135 --- cutestuff/util/bytestream.h (revision 355)
136 +++ cutestuff/util/bytestream.h (working copy)
137 @@ -24,10 +24,11 @@
138 #include <qobject.h>
139 #include <q3cstring.h>
141 +#include <cutestuff_export.h>
142 // CS_NAMESPACE_BEGIN
144 // CS_EXPORT_BEGIN
145 -class ByteStream : public QObject
146 +class CUTESTUFF_EXPORT ByteStream : public QObject
148 Q_OBJECT
149 public:
150 Index: iris/include/im.h
151 ===================================================================
152 --- iris/include/im.h (revision 355)
153 +++ iris/include/im.h (working copy)
154 @@ -34,9 +34,27 @@
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"); \
164 + return false; \
166 +# define IRIS_DUMMY_QHASH_FUNCTION(C) \
167 + inline uint qHash(const C) { \
168 + qWarning("inline uint qHash(const "#C") was called"); \
169 + return 0; \
171 +#else
172 +# define IRIS_DUMMY_COMPARISON_OPERATOR(C)
173 +# define IRIS_DUMMY_QHASH_FUNCTION(C)
174 +#endif
176 namespace XMPP
178 - class Url
179 + class IRIS_EXPORT Url
181 public:
182 Url(const QString &url="", const QString &desc="");
183 @@ -91,7 +109,7 @@
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;
192 @@ -108,7 +126,7 @@
193 QDomElement payload_;
196 - class HTMLElement
197 + class IRIS_EXPORT HTMLElement
199 public:
200 HTMLElement();
201 @@ -149,7 +167,7 @@
202 bool hasId_;
205 - class Message
206 + class IRIS_EXPORT Message
208 public:
209 Message(const Jid &to="");
210 @@ -267,7 +285,7 @@
211 Private *d;
214 - class Subscription
215 + class IRIS_EXPORT Subscription
217 public:
218 enum SubType { None, To, From, Both, Remove };
219 @@ -283,7 +301,7 @@
220 SubType value;
223 - class Resource
224 + class IRIS_EXPORT Resource
226 public:
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)
233 private:
234 QString v_name;
235 Status v_status;
237 + IRIS_DUMMY_QHASH_FUNCTION(Resource)
239 - class ResourceList : public QList<Resource>
240 + class IRIS_EXPORT ResourceList : public QList<Resource>
242 public:
243 ResourceList();
244 @@ -314,7 +334,7 @@
245 ResourceList::ConstIterator priority() const;
248 - class RosterItem
249 + class IRIS_EXPORT RosterItem
251 public:
252 RosterItem(const Jid &jid="");
253 @@ -340,6 +360,7 @@
254 QDomElement toXml(QDomDocument *) const;
255 bool fromXml(const QDomElement &);
257 + IRIS_DUMMY_COMPARISON_OPERATOR(RosterItem)
258 private:
259 Jid v_jid;
260 QString v_name;
261 @@ -348,8 +369,9 @@
262 QString v_ask;
263 bool v_push;
265 + IRIS_DUMMY_QHASH_FUNCTION(RosterItem)
267 - class Roster : public QList<RosterItem>
268 + class IRIS_EXPORT Roster : public QList<RosterItem>
270 public:
271 Roster();
272 @@ -362,7 +384,7 @@
273 class RosterPrivate *d;
276 - class AgentItem
277 + class IRIS_EXPORT AgentItem
279 public:
280 AgentItem() { }
281 @@ -387,7 +409,7 @@
283 typedef QList<AgentItem> AgentList;
285 - class DiscoItem
286 + class IRIS_EXPORT DiscoItem
288 public:
289 DiscoItem();
290 @@ -443,7 +465,7 @@
292 typedef QList<DiscoItem> DiscoList;
294 - class FormField
295 + class IRIS_EXPORT FormField
297 public:
298 enum { username, nick, password, name, first, last, email, address, city, state, zip, phone, url, date, misc };
299 @@ -459,6 +481,8 @@
300 bool setType(const QString &);
301 void setValue(const QString &);
303 + IRIS_DUMMY_COMPARISON_OPERATOR(FormField)
305 private:
306 int tagNameToType(const QString &) const;
307 QString typeToTagName(int) const;
308 @@ -469,8 +493,9 @@
309 class Private;
310 Private *d;
312 + IRIS_DUMMY_QHASH_FUNCTION(FormField)
314 - class Form : public QList<FormField>
315 + class IRIS_EXPORT Form : public QList<FormField>
317 public:
318 Form(const Jid &j="");
319 @@ -491,7 +516,7 @@
320 Private *d;
323 - class SearchResult
324 + class IRIS_EXPORT SearchResult
326 public:
327 SearchResult(const Jid &jid="");
328 @@ -522,7 +547,7 @@
329 class JidLinkManager;
330 class FileTransferManager;
332 - class Client : public QObject
333 + class IRIS_EXPORT Client : public QObject
335 Q_OBJECT
337 @@ -657,7 +682,7 @@
338 ClientPrivate *d;
341 - class LiveRosterItem : public RosterItem
342 + class IRIS_EXPORT LiveRosterItem : public RosterItem
344 public:
345 LiveRosterItem(const Jid &j="");
346 @@ -685,7 +710,7 @@
347 bool v_flagForDelete;
350 - class LiveRoster : public QList<LiveRosterItem>
351 + class IRIS_EXPORT LiveRoster : public QList<LiveRosterItem>
353 public:
354 LiveRoster();
355 Index: iris/include/xmpp.h
356 ===================================================================
357 --- iris/include/xmpp.h (revision 355)
358 +++ iris/include/xmpp.h (working copy)
359 @@ -32,10 +32,12 @@
361 #include "xmpp_jid.h"
363 +#include <iris_export.h>
365 namespace QCA
367 class TLS;
371 #ifndef CS_XMPP
372 class ByteStream;
373 @@ -65,7 +67,7 @@
375 void setDebug(Debug *);
377 - class Connector : public QObject
378 + class IRIS_EXPORT Connector : public QObject
380 Q_OBJECT
381 public:
382 @@ -97,7 +99,7 @@
383 quint16 port;
386 - class AdvancedConnector : public Connector
387 + class IRIS_EXPORT AdvancedConnector : public Connector
389 Q_OBJECT
390 public:
391 @@ -171,7 +173,7 @@
392 void tryNextSrv();
395 - class TLSHandler : public QObject
396 + class IRIS_EXPORT TLSHandler : public QObject
398 Q_OBJECT
399 public:
400 @@ -191,7 +193,7 @@
401 void readyReadOutgoing(const QByteArray &a, int plainBytes);
404 - class QCATLSHandler : public TLSHandler
405 + class IRIS_EXPORT QCATLSHandler : public TLSHandler
407 Q_OBJECT
408 public:
409 @@ -225,7 +227,7 @@
412 class Stream;
413 - class Stanza
414 + class IRIS_EXPORT Stanza
416 public:
417 enum Kind { Message, Presence, IQ };
418 @@ -324,7 +326,7 @@
419 Private *d;
422 - class Stream : public QObject
423 + class IRIS_EXPORT Stream : public QObject
425 Q_OBJECT
426 public:
427 @@ -370,7 +372,7 @@
428 void error(int);
431 - class ClientStream : public Stream
432 + class IRIS_EXPORT ClientStream : public Stream
434 Q_OBJECT
435 public:
436 @@ -522,6 +524,6 @@
437 void handleError();
438 void srvProcessNext();
443 #endif
444 Index: iris/include/xmpp_features.h
445 ===================================================================
446 --- iris/include/xmpp_features.h (revision 355)
447 +++ iris/include/xmpp_features.h (working copy)
448 @@ -24,9 +24,11 @@
449 #include <QStringList>
452 +#include <iris_export.h>
454 namespace XMPP
456 - class Features
457 + class IRIS_EXPORT Features
459 public:
460 Features();
461 @@ -47,6 +49,7 @@
462 bool canDisco() const;
463 bool canChatState() const;
464 bool canCommand() const;
465 + bool canXHTML() const;
466 bool isGateway() const;
467 bool haveVCard() const;
469 @@ -60,6 +63,7 @@
470 FID_Gateway,
471 FID_VCard,
472 FID_AHCommand,
473 + FID_Xhtml,
475 // private Psi actions
476 FID_Add
477 Index: iris/include/xmpp_jid.h
478 ===================================================================
479 --- iris/include/xmpp_jid.h (revision 355)
480 +++ iris/include/xmpp_jid.h (working copy)
481 @@ -23,9 +23,11 @@
485 +#include <iris_export.h>
487 namespace XMPP
489 - class Jid
490 + class IRIS_EXPORT Jid
492 public:
493 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)
498 @@ -26,9 +26,11 @@
500 #include "xmpp_muc.h"
502 +#include <iris_export.h>
504 namespace XMPP
506 - class Status
507 + class IRIS_EXPORT Status
509 public:
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)
515 @@ -24,6 +24,8 @@
516 #include <QObject>
519 +#include <iris_export.h>
521 class QDomDocument;
522 class QDomElement;
524 @@ -31,7 +33,7 @@
525 class Client;
526 class Jid;
528 - class Task : public QObject
529 + class IRIS_EXPORT Task : public QObject
531 Q_OBJECT
532 public:
533 Index: iris/include/xmpp_xdata.h
534 ===================================================================
535 --- iris/include/xmpp_xdata.h (revision 355)
536 +++ iris/include/xmpp_xdata.h (working copy)
537 @@ -147,6 +147,6 @@
538 QSharedDataPointer<Private> d;
544 #endif
545 Index: iris/jabber/filetransfer.cpp
546 ===================================================================
547 --- iris/jabber/filetransfer.cpp (revision 355)
548 +++ iris/jabber/filetransfer.cpp (working copy)
549 @@ -56,6 +56,7 @@
550 qlonglong size;
551 qlonglong sent;
552 QString desc;
553 + QString preview;
554 bool rangeSupported;
555 qlonglong rangeOffset, rangeLength, length;
556 QString streamType;
557 @@ -104,13 +105,14 @@
558 d->proxy = proxy;
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;
565 d->peer = to;
566 d->fname = fname;
567 d->size = size;
568 d->desc = desc;
569 + d->preview = preview;
570 d->sender = true;
571 d->id = d->m->link(this);
573 @@ -118,7 +120,7 @@
574 connect(d->ft, SIGNAL(finished()), SLOT(ft_finished()));
575 QStringList list;
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);
579 d->ft->go(true);
582 @@ -171,6 +173,12 @@
583 return d->desc;
587 +QString XMPP::FileTransfer::preview() const
589 + return d->preview;
592 bool FileTransfer::rangeSupported() const
594 return d->rangeSupported;
595 @@ -312,6 +320,7 @@
596 d->fname = req.fname;
597 d->size = req.size;
598 d->desc = req.desc;
599 + d->preview = req.preview;
600 d->rangeSupported = req.rangeSupported;
603 @@ -461,7 +470,7 @@
604 delete d;
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)
610 QDomElement iq;
611 d->to = to;
612 @@ -480,6 +489,12 @@
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);
625 @@ -719,6 +734,11 @@
626 QDomElement de = file.elementsByTagName("desc").item(0).toElement();
627 if(!de.isNull())
628 desc = de.text();
630 + QString preview;
631 + QDomElement pr = file.elementsByTagName("preview").item(0).toElement();
632 + if(!pr.isNull())
633 + preview= pr.text();
635 bool rangeSupported = false;
636 QDomElement range = file.elementsByTagName("range").item(0).toElement();
637 @@ -750,6 +770,7 @@
638 r.fname = fname;
639 r.size = size;
640 r.desc = desc;
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)
649 @@ -40,7 +40,7 @@
650 virtual void accept(qlonglong offset=0, qlonglong length=0) = 0;
651 };*/
653 - class FileTransfer : public QObject /*, public AbstractFileTransfer */
654 + class IRIS_EXPORT FileTransfer : public QObject /*, public AbstractFileTransfer */
656 Q_OBJECT
657 public:
658 @@ -51,7 +51,7 @@
659 void setProxy(const Jid &proxy);
661 // send
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;
667 @@ -62,6 +62,7 @@
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);
675 @@ -97,7 +98,7 @@
676 void takeConnection(S5BConnection *c);
679 - class FileTransferManager : public QObject
680 + class IRIS_EXPORT FileTransferManager : public QObject
682 Q_OBJECT
683 public:
684 @@ -128,14 +129,14 @@
685 void unlink(FileTransfer *);
688 - class JT_FT : public Task
689 + class IRIS_EXPORT JT_FT : public Task
691 Q_OBJECT
692 public:
693 JT_FT(Task *parent);
694 ~JT_FT();
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;
701 @@ -155,6 +156,7 @@
702 QString fname;
703 qlonglong size;
704 QString desc;
705 + QString preview;
706 bool rangeSupported;
707 QStringList streamTypes;
709 Index: iris/jabber/s5b.cpp
710 ===================================================================
711 --- iris/jabber/s5b.cpp (revision 355)
712 +++ iris/jabber/s5b.cpp (working copy)
713 @@ -33,6 +33,7 @@
715 #ifdef Q_OS_WIN
716 # include <windows.h>
717 +# include <winsock2.h>
718 #else
719 # include <netinet/in.h>
720 #endif
721 @@ -46,7 +47,7 @@
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)
734 @@ -46,7 +46,7 @@
735 typedef Q3PtrList<S5BConnection> S5BConnectionList;
736 typedef Q3PtrListIterator<S5BConnection> S5BConnectionListIt;
738 - class S5BDatagram
739 + class IRIS_EXPORT S5BDatagram
741 public:
742 S5BDatagram();
743 @@ -61,7 +61,7 @@
744 QByteArray _buf;
747 - class S5BConnection : public ByteStream
748 + class IRIS_EXPORT S5BConnection : public ByteStream
750 Q_OBJECT
751 public:
752 @@ -131,7 +131,7 @@
753 S5BConnection(S5BManager *, QObject *parent=0);
756 - class S5BManager : public QObject
757 + class IRIS_EXPORT S5BManager : public QObject
759 Q_OBJECT
760 public:
761 @@ -200,7 +200,7 @@
762 void doActivate(const Jid &peer, const QString &sid, const Jid &streamHost);
765 - class S5BConnector : public QObject
766 + class IRIS_EXPORT S5BConnector : public QObject
768 Q_OBJECT
769 public:
770 @@ -231,7 +231,7 @@
773 // listens on a port for serving
774 - class S5BServer : public QObject
775 + class IRIS_EXPORT S5BServer : public QObject
777 Q_OBJECT
778 public:
779 @@ -264,7 +264,7 @@
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
786 Q_OBJECT
787 public:
788 @@ -290,7 +290,7 @@
789 Private *d;
792 - struct S5BRequest
793 + struct IRIS_EXPORT S5BRequest
795 Jid from;
796 QString id, sid;
797 @@ -298,7 +298,7 @@
798 bool fast;
799 bool udp;
801 - class JT_PushS5B : public Task
802 + class IRIS_EXPORT JT_PushS5B : public Task
804 Q_OBJECT
805 public:
806 @@ -320,7 +320,7 @@
807 void incomingActivate(const Jid &from, const QString &sid, const Jid &streamHost);
810 - class StreamHost
811 + class IRIS_EXPORT StreamHost
813 public:
814 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)
819 @@ -34,7 +34,7 @@
820 class IBBManager;
822 // this is an IBB connection. use it much like a qsocket
823 - class IBBConnection : public ByteStream
824 + class IRIS_EXPORT IBBConnection : public ByteStream
826 Q_OBJECT
827 public:
828 @@ -78,7 +78,7 @@
830 typedef Q3PtrList<IBBConnection> IBBConnectionList;
831 typedef Q3PtrListIterator<IBBConnection> IBBConnectionListIt;
832 - class IBBManager : public QObject
833 + class IRIS_EXPORT IBBManager : public QObject
835 Q_OBJECT
836 public:
837 @@ -111,7 +111,7 @@
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
844 Q_OBJECT
845 public:
846 Index: iris/xmpp-core/compress.cpp
847 ===================================================================
848 --- iris/xmpp-core/compress.cpp (revision 355)
849 +++ iris/xmpp-core/compress.cpp (working copy)
850 @@ -1,6 +1,7 @@
851 #include <QObject>
852 #include <QIODevice>
853 #include <zlib.h>
854 +#include <stdlib.h>
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)
862 @@ -239,6 +239,9 @@
863 b = d;
864 else
865 b = n + '@' + d;
867 + b=b.toLower(); // JID are not case sensitive
869 if(r.isEmpty())
870 f = b;
871 else
872 Index: iris/xmpp-core/parser.cpp
873 ===================================================================
874 --- iris/xmpp-core/parser.cpp (revision 355)
875 +++ iris/xmpp-core/parser.cpp (working copy)
876 @@ -547,7 +547,7 @@
877 Q3PtrList<Parser::Event> eventList;
878 bool needMore;
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)));
896 else {
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)
902 @@ -37,6 +37,7 @@
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)
914 @@ -349,7 +349,7 @@
916 // build 'response'
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());
937 @@ -512,6 +512,10 @@
941 + int version() const {
942 + return QCA_VERSION;
945 QString name() const {
946 return "simplesasl";
948 Index: iris/xmpp-core/stream.cpp
949 ===================================================================
950 --- iris/xmpp-core/stream.cpp (revision 355)
951 +++ iris/xmpp-core/stream.cpp (working copy)
952 @@ -87,7 +87,7 @@
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");
964 // calculate key
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)
978 @@ -24,6 +24,7 @@
979 #include <qapplication.h>
980 //Added by qt3to4:
981 #include <QList>
982 +#include "protocol.h"
984 #define NS_XML "http://www.w3.org/XML/1998/namespace"
986 @@ -1515,28 +1516,48 @@
987 else
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) {
995 switch (*ev) {
996 case OfflineEvent:
997 x.appendChild(s.createElement("jabber:x:event", "offline"));
998 + need_x_event=true;
999 break;
1000 case DeliveredEvent:
1001 x.appendChild(s.createElement("jabber:x:event", "delivered"));
1002 + need_x_event=true;
1003 break;
1004 case DisplayedEvent:
1005 x.appendChild(s.createElement("jabber:x:event", "displayed"));
1006 + need_x_event=true;
1007 break;
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" ) );
1013 break;
1014 case CancelEvent:
1015 - // Add nothing
1016 + need_x_event=true;
1017 + if (d->body.isEmpty() && (d->type=="chat" || d->type=="groupchat") )
1018 + s.appendChild( s.createElement(NS_CHATSTATES , "paused" ) );
1019 break;
1022 - s.appendChild(x);
1023 - }
1024 + case InactiveEvent:
1025 + if (d->body.isEmpty() && (d->type=="chat" || d->type=="groupchat") )
1026 + s.appendChild( s.createElement(NS_CHATSTATES , "inactive" ) );
1027 + break;
1028 + case GoneEvent:
1029 + if (d->body.isEmpty() && (d->type=="chat" || d->type=="groupchat") )
1030 + s.appendChild( s.createElement(NS_CHATSTATES , "gone" ) );
1031 + break;
1034 + if(need_x_event) //we don't need to have the (empty) x:event element if this is only <gone> or <inactive>
1035 + s.appendChild(x);
1038 // chat state
1039 QString chatStateNS = "http://jabber.org/protocol/chatstates";
1040 @@ -1647,6 +1668,7 @@
1041 d->body.clear();
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;
1079 else {
1080 //printf("extension element: [%s]\n", e.tagName().latin1());
1082 @@ -1733,7 +1782,6 @@
1085 // events
1086 - d->eventList.clear();
1087 nl = root.elementsByTagNameNS("jabber:x:event", "x");
1088 if (nl.count()) {
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 @@
1100 return test(ns);
1103 +#define FID_XHTML "http://jabber.org/protocol/xhtml-im"
1104 +bool Features::canXHTML() const
1106 + QStringList ns;
1107 + ns << FID_XHTML;
1108 + return test(ns);
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
1126 +public:
1127 + Private() {}
1129 + int seconds;
1130 + QString message;
1133 +JT_GetLastActivity::JT_GetLastActivity(Task *parent)
1134 +:Task(parent)
1136 + d = new Private;
1139 +JT_GetLastActivity::~JT_GetLastActivity()
1141 + delete d;
1144 +void JT_GetLastActivity::get(const Jid &j)
1146 + 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()
1165 + send(iq);
1168 +bool JT_GetLastActivity::take(const QDomElement &x)
1170 + if(!iqVerify(x, jid, id()))
1171 + return false;
1173 + if(x.attribute("type") == "result") {
1174 + QDomElement q = queryTag(x);
1176 + d->message = q.text();
1177 + bool ok;
1178 + d->seconds = q.attribute("seconds").toInt(&ok);
1180 + setSuccess(ok);
1182 + else {
1183 + setError(x);
1186 + return true;
1189 +//----------------------------------------------------------------------------
1190 // JT_GetServices
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 @@
1205 return true;
1211 +//----------------------------------------------------------------------------
1212 +// JT_PrivateStorage
1213 +//----------------------------------------------------------------------------
1214 +class JT_PrivateStorage::Private
1216 + public:
1217 + Private() : type(-1) {}
1219 + QDomElement iq;
1220 + QDomElement elem;
1221 + int type;
1224 +JT_PrivateStorage::JT_PrivateStorage(Task *parent)
1225 + :Task(parent)
1227 + d = new Private;
1230 +JT_PrivateStorage::~JT_PrivateStorage()
1232 + delete d;
1235 +void JT_PrivateStorage::get(const QString& tag, const QString& xmlns)
1237 + d->type = 0;
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)
1250 + d->type = 1;
1251 + d->elem=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()
1263 + send(d->iq);
1266 +bool JT_PrivateStorage::take(const QDomElement &x)
1268 + QString to = client()->host();
1269 + if(!iqVerify(x, to, id()))
1270 + return false;
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();
1277 + if(i.isNull())
1278 + continue;
1279 + d->elem=i;
1280 + break;
1283 + setSuccess();
1284 + return true;
1286 + else {
1287 + setError(x);
1290 + return true;
1294 +QDomElement JT_PrivateStorage::element( )
1296 + return d->elem;
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)
1302 @@ -34,7 +34,7 @@
1303 class Roster;
1304 class Status;
1306 - class JT_Register : public Task
1307 + class IRIS_EXPORT JT_Register : public Task
1309 Q_OBJECT
1310 public:
1311 @@ -65,7 +65,7 @@
1312 Private *d;
1315 - class JT_UnRegister : public Task
1316 + class IRIS_EXPORT JT_UnRegister : public Task
1318 Q_OBJECT
1319 public:
1320 @@ -85,7 +85,7 @@
1321 Private *d;
1324 - class JT_Roster : public Task
1325 + class IRIS_EXPORT JT_Roster : public Task
1327 Q_OBJECT
1328 public:
1329 @@ -113,7 +113,7 @@
1330 Private *d;
1333 - class JT_PushRoster : public Task
1334 + class IRIS_EXPORT JT_PushRoster : public Task
1336 Q_OBJECT
1337 public:
1338 @@ -130,7 +130,7 @@
1339 Private *d;
1342 - class JT_Presence : public Task
1343 + class IRIS_EXPORT JT_Presence : public Task
1345 Q_OBJECT
1346 public:
1347 @@ -151,7 +151,7 @@
1348 Private *d;
1351 - class JT_PushPresence : public Task
1352 + class IRIS_EXPORT JT_PushPresence : public Task
1354 Q_OBJECT
1355 public:
1356 @@ -177,7 +177,7 @@
1357 bool take(const QDomElement&);
1360 - class JT_Message : public Task
1361 + class IRIS_EXPORT JT_Message : public Task
1363 Q_OBJECT
1364 public:
1365 @@ -193,7 +193,7 @@
1366 Private *d;
1369 - class JT_PushMessage : public Task
1370 + class IRIS_EXPORT JT_PushMessage : public Task
1372 Q_OBJECT
1373 public:
1374 @@ -210,10 +210,33 @@
1375 Private *d;
1378 - class JT_GetServices : public Task
1379 + class IRIS_EXPORT JT_GetLastActivity : public Task
1381 Q_OBJECT
1382 public:
1383 + JT_GetLastActivity(Task *);
1384 + ~JT_GetLastActivity();
1386 + void get(const Jid &);
1388 + int seconds() const;
1389 + const QString &message() const;
1391 + void onGo();
1392 + bool take(const QDomElement &x);
1394 + private:
1395 + class Private;
1396 + Private *d;
1398 + QDomElement iq;
1399 + Jid jid;
1400 + };
1402 + class IRIS_EXPORT JT_GetServices : public Task
1404 + Q_OBJECT
1405 + public:
1406 JT_GetServices(Task *);
1408 void get(const Jid &);
1409 @@ -232,7 +255,7 @@
1410 AgentList agentList;
1413 - class JT_VCard : public Task
1414 + class IRIS_EXPORT JT_VCard : public Task
1416 Q_OBJECT
1417 public:
1418 @@ -255,7 +278,7 @@
1419 Private *d;
1422 - class JT_Search : public Task
1423 + class IRIS_EXPORT JT_Search : public Task
1425 Q_OBJECT
1426 public:
1427 @@ -279,7 +302,7 @@
1428 Private *d;
1431 - class JT_ClientVersion : public Task
1432 + class IRIS_EXPORT JT_ClientVersion : public Task
1434 Q_OBJECT
1435 public:
1436 @@ -318,7 +341,7 @@
1437 QDomElement iq;
1440 - class JT_ServInfo : public Task
1441 + class IRIS_EXPORT JT_ServInfo : public Task
1443 Q_OBJECT
1444 public:
1445 @@ -328,7 +351,7 @@
1446 bool take(const QDomElement &);
1449 - class JT_Gateway : public Task
1450 + class IRIS_EXPORT JT_Gateway : public Task
1452 Q_OBJECT
1453 public:
1454 @@ -351,7 +374,7 @@
1455 QString v_prompt, v_desc;
1458 - class JT_Browse : public Task
1459 + class IRIS_EXPORT JT_Browse : public Task
1461 Q_OBJECT
1462 public:
1463 @@ -373,7 +396,7 @@
1464 AgentItem browseHelper (const QDomElement &i);
1467 - class JT_DiscoItems : public Task
1468 + class IRIS_EXPORT JT_DiscoItems : public Task
1470 Q_OBJECT
1471 public:
1472 @@ -393,7 +416,7 @@
1473 Private *d;
1476 - class JT_DiscoInfo : public Task
1477 + class IRIS_EXPORT JT_DiscoInfo : public Task
1479 Q_OBJECT
1480 public:
1481 @@ -415,7 +438,7 @@
1482 Private *d;
1485 - class JT_DiscoPublish : public Task
1486 + class IRIS_EXPORT JT_DiscoPublish : public Task
1488 Q_OBJECT
1489 public:
1490 @@ -431,6 +454,27 @@
1491 class Private;
1492 Private *d;
1495 + class IRIS_EXPORT JT_PrivateStorage : public Task
1497 + Q_OBJECT
1498 + public:
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();
1507 + void onGo();
1508 + bool take(const QDomElement &);
1510 + private:
1511 + class Private;
1512 + Private *d;
1513 + };
1517 #endif
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)
1522 @@ -28,11 +28,18 @@
1523 #include <QList>
1524 #include <qdom.h>
1526 +#include <iris_export.h>
1528 +// timezone() conflicts with a define/whatever deep inside win-sdk headers
1529 +#ifdef Q_OS_WIN
1530 +# undef timezone
1531 +#endif
1533 class QDate;
1535 namespace XMPP
1537 - class VCard
1538 + class IRIS_EXPORT VCard
1540 public:
1541 VCard();
1542 @@ -85,7 +92,7 @@
1543 void setBdayStr(const QString &);
1546 - class Address {
1547 + class IRIS_EXPORT Address {
1548 public:
1549 Address();
1551 @@ -111,7 +118,7 @@
1552 const AddressList &addressList() const;
1553 void setAddressList(const AddressList &);
1555 - class Label {
1556 + class IRIS_EXPORT Label {
1557 public:
1558 Label();
1560 @@ -132,7 +139,7 @@
1561 void setLabelList(const LabelList &);
1564 - class Phone {
1565 + class IRIS_EXPORT Phone {
1566 public:
1567 Phone();
1569 @@ -157,7 +164,7 @@
1570 void setPhoneList(const PhoneList &);
1573 - class Email {
1574 + class IRIS_EXPORT Email {
1575 public:
1576 Email();
1578 @@ -183,7 +190,7 @@
1579 void setTimezone(const QString &);
1582 - class Geo {
1583 + class IRIS_EXPORT Geo {
1584 public:
1585 Geo();
1587 @@ -215,7 +222,7 @@
1588 void setAgentURI(const QString &);
1591 - class Org {
1592 + class IRIS_EXPORT Org {
1593 public:
1594 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)
1600 @@ -468,5 +468,5 @@
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)
1611 @@ -67,6 +67,6 @@
1612 void readBoolAttribute(QDomElement e, const QString &name, bool *v);
1614 //QString tagContent(const QDomElement &e); // obsolete;
1618 #endif