summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-24 16:35:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-24 16:35:14 +0000
commitc47ca004ba979d23a86211393c9e35deadd66c46 (patch)
treece49a57e87bf5caac81d2d54a590e3aea3d61ea3 /protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
parent126f606ea6a845d914e3ff074dc725443bb57bf0 (diff)
adaptation of WhatsApp for protocol version 1.5/2.0
git-svn-id: http://svn.miranda-ng.org/main/trunk@11898 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp')
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp263
1 files changed, 24 insertions, 239 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
index 8fb24b443b..352d49b07d 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
+++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
@@ -12,245 +12,31 @@
#include "utilities.h"
const char* WAConnection::dictionary[] = {
- "",
- "",
- "",
- "",
- "",
- "account",
- "ack",
- "action",
- "active",
- "add",
- "after",
- "ib",
- "all",
- "allow",
- "apple",
- "audio",
- "auth",
- "author",
- "available",
- "bad-protocol",
- "bad-request",
- "before",
- "Bell.caf",
- "body",
- "Boing.caf",
- "cancel",
- "category",
- "challenge",
- "chat",
- "clean",
- "code",
- "composing",
- "config",
- "conflict",
- "contacts",
- "count",
- "create",
- "creation",
- "default",
- "delay",
- "delete",
- "delivered",
- "deny",
- "digest",
- "DIGEST-MD5-1",
- "DIGEST-MD5-2",
- "dirty",
- "elapsed",
- "broadcast",
- "enable",
- "encoding",
- "duplicate",
- "error",
- "event",
- "expiration",
- "expired",
- "fail",
- "failure",
- "false",
- "favorites",
- "feature",
- "features",
- "field",
- "first",
- "free",
- "from",
- "g.us",
- "get",
- "Glass.caf",
- "google",
- "group",
- "groups",
- "g_notify",
- "g_sound",
- "Harp.caf",
- "http://etherx.jabber.org/streams",
- "http://jabber.org/protocol/chatstates",
- "id",
- "image",
- "img",
- "inactive",
- "index",
- "internal-server-error",
- "invalid-mechanism",
- "ip",
- "iq",
- "item",
- "item-not-found",
- "user-not-found",
- "jabber:iq:last",
- "jabber:iq:privacy",
- "jabber:x:delay",
- "jabber:x:event",
- "jid",
- "jid-malformed",
- "kind",
- "last",
- "latitude",
- "lc",
- "leave",
- "leave-all",
- "lg",
- "list",
- "location",
- "longitude",
- "max",
- "max_groups",
- "max_participants",
- "max_subject",
- "mechanism",
- "media",
- "message",
- "message_acks",
- "method",
- "microsoft",
- "missing",
- "modify",
- "mute",
- "name",
- "nokia",
- "none",
- "not-acceptable",
- "not-allowed",
- "not-authorized",
- "notification",
- "notify",
- "off",
- "offline",
- "order",
- "owner",
- "owning",
- "paid",
- "participant",
- "participants",
- "participating",
- "password",
- "paused",
- "picture",
- "pin",
- "ping",
- "platform",
- "pop_mean_time",
- "pop_plus_minus",
- "port",
- "presence",
- "preview",
- "probe",
- "proceed",
- "prop",
- "props",
- "p_o",
- "p_t",
- "query",
- "raw",
- "reason",
- "receipt",
- "receipt_acks",
- "received",
- "registration",
- "relay",
- "remote-server-timeout",
- "remove",
- "Replaced by new connection",
- "request",
- "required",
- "resource",
- "resource-constraint",
- "response",
- "result",
- "retry",
- "rim",
- "s.whatsapp.net",
- "s.us",
- "seconds",
- "server",
- "server-error",
- "service-unavailable",
- "set",
- "show",
- "sid",
- "silent",
- "sound",
- "stamp",
- "unsubscribe",
- "stat",
- "status",
- "stream:error",
- "stream:features",
- "subject",
- "subscribe",
- "success",
- "sync",
- "system-shutdown",
- "s_o",
- "s_t",
- "t",
- "text",
- "timeout",
- "TimePassing.caf",
- "timestamp",
- "to",
- "Tri-tone.caf",
- "true",
- "type",
- "unavailable",
- "uri",
- "url",
- "urn:ietf:params:xml:ns:xmpp-sasl",
- "urn:ietf:params:xml:ns:xmpp-stanzas",
- "urn:ietf:params:xml:ns:xmpp-streams",
- "urn:xmpp:delay",
- "urn:xmpp:ping",
- "urn:xmpp:receipts",
- "urn:xmpp:whatsapp",
- "urn:xmpp:whatsapp:account",
- "urn:xmpp:whatsapp:dirty",
- "urn:xmpp:whatsapp:mms",
- "urn:xmpp:whatsapp:push",
- "user",
- "username",
- "value",
- "vcard",
- "version",
- "video",
- "w",
- "w:g",
- "w:p",
- "w:p:r",
- "w:profile:picture",
- "wait",
- "x",
- "xml-not-well-formed",
- "xmlns",
- "xmlns:stream",
- "Xylophone.caf",
- "1",
- "WAUTH-1"
+ "", "", "", "account", "ack", "action", "active", "add", "after", "all", "allow", "apple", "auth", "author", "available",
+ "bad-protocol", "bad-request", "before", "body", "broadcast", "cancel", "category", "challenge", "chat", "clean", "code",
+ "composing", "config", "contacts", "count", "create", "creation", "debug", "default", "delete", "delivery", "delta", "deny",
+ "digest", "dirty", "duplicate", "elapsed", "enable", "encoding", "error", "event", "expiration", "expired", "fail", "failure",
+ "false", "favorites", "feature", "features", "feature-not-implemented", "field", "first", "free", "from", "g.us", "get", "google",
+ "group", "groups", "groups_v2", "http://etherx.jabber.org/streams", "http://jabber.org/protocol/chatstates", "ib", "id", "image",
+ "img", "index", "internal-server-error", "ip", "iq", "item-not-found", "item", "jabber:iq:last", "jabber:iq:privacy", "jabber:x:event",
+ "jid", "kind", "last", "leave", "list", "max", "mechanism", "media", "message_acks", "message", "method", "microsoft", "missing",
+ "modify", "mute", "name", "nokia", "none", "not-acceptable", "not-allowed", "not-authorized", "notification", "notify", "off",
+ "offline", "order", "owner", "owning", "p_o", "p_t", "paid", "participant", "participants", "participating", "paused", "picture",
+ "pin", "ping", "platform", "port", "presence", "preview", "probe", "prop", "props", "query", "raw", "read", "readreceipts", "reason",
+ "receipt", "relay", "remote-server-timeout", "remove", "request", "required", "resource-constraint", "resource", "response", "result",
+ "retry", "rim", "s_o", "s_t", "s.us", "s.whatsapp.net", "seconds", "server-error", "server", "service-unavailable", "set", "show", "silent",
+ "stat", "status", "stream:error", "stream:features", "subject", "subscribe", "success", "sync", "t", "text", "timeout", "timestamp", "to",
+ "true", "type", "unavailable", "unsubscribe", "uri", "url", "urn:ietf:params:xml:ns:xmpp-sasl", "urn:ietf:params:xml:ns:xmpp-stanzas",
+ "urn:ietf:params:xml:ns:xmpp-streams", "urn:xmpp:ping", "urn:xmpp:whatsapp:account", "urn:xmpp:whatsapp:dirty", "urn:xmpp:whatsapp:mms",
+ "urn:xmpp:whatsapp:push", "urn:xmpp:whatsapp", "user", "user-not-found", "value", "version", "w:g", "w:p:r", "w:p", "w:profile:picture",
+ "w", "wait", "WAUTH-2", "xmlns:stream", "xmlns", "1", "chatstate", "crypto", "phash", "enc", "class", "off_cnt", "w:g2", "promote",
+ "demote", "creator", "Bell.caf", "Boing.caf", "Glass.caf", "Harp.caf", "TimePassing.caf", "Tri-tone.caf", "Xylophone.caf", "background",
+ "backoff", "chunked", "context", "full", "in", "interactive", "out", "registration", "sid", "urn:xmpp:whatsapp:sync", "flt", "s16", "u8",
+ "adpcm", "amrnb", "amrwb", "mp3", "pcm", "qcelp", "wma", "h263", "h264", "jpeg"
};
+const int WAConnection::DICTIONARY_LEN = _countof(WAConnection::dictionary);
+
WAConnection::WAConnection(IMutex* mutex, WAListener* event_handler, WAGroupListener* group_event_handler)
{
this->init(event_handler, group_event_handler, mutex);
@@ -263,9 +49,8 @@ WAConnection::~WAConnection()
delete this->in;
delete this->out;
std::map<string, IqResultHandler*>::iterator it;
- for (it = this->pending_server_requests.begin(); it != this->pending_server_requests.end(); it++) {
+ for (it = this->pending_server_requests.begin(); it != this->pending_server_requests.end(); it++)
delete it->second;
- }
}
void WAConnection::init(WAListener* event_handler, WAGroupListener* group_event_handler, IMutex* mutex)