aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/QXmppUtils.cpp')
-rw-r--r--source/QXmppUtils.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/QXmppUtils.cpp b/source/QXmppUtils.cpp
index 08c1543a..095c746a 100644
--- a/source/QXmppUtils.cpp
+++ b/source/QXmppUtils.cpp
@@ -30,6 +30,7 @@
#include <QBuffer>
#include <QImageReader>
#include <QCryptographicHash>
+#include <QDateTime>
QString jidToResource(const QString& jid)
{
@@ -41,6 +42,18 @@ QString jidToBareJid(const QString& jid)
return jid.left(jid.indexOf(QChar('/')));
}
+QString generateStanzaHash()
+{
+
+ QString somechars = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QString hashResult;
+ for ( int idx = 0; idx < 10; ++idx )
+ {
+ hashResult += somechars[(qrand() % 61)];
+ }
+ return hashResult;
+}
+
void helperToXmlAddAttribute(QXmlStreamWriter* stream, const QString& name,
const QString& value)
{