From 10c093a617929db5c6b201dbf03d6070b12b36b4 Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Tue, 27 Oct 2009 12:04:03 +0000 Subject: Issue 15: Implement XEP-0047 --- source/QXmppUtils.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/QXmppUtils.cpp') 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 #include #include +#include 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) { -- cgit v1.2.3