From b32bd0a340de47fda10fbca63c6cf664327533cf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 2 Sep 2015 18:01:59 +0000 Subject: WhatsApp: - added ability to send media files (patch by Cassio); - fix for wrongly sent acks (patch by Cassio); - project files cleaned up; - version bump; git-svn-id: http://svn.miranda-ng.org/main/trunk@15154 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/utils.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'protocols/WhatsApp/src/utils.cpp') diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp index 6d7e77b15a..4458f976f0 100644 --- a/protocols/WhatsApp/src/utils.cpp +++ b/protocols/WhatsApp/src/utils.cpp @@ -76,3 +76,20 @@ void md5_string(const std::string &data, BYTE digest[16]) { utils::md5string(data, digest); } + +std::vector &split(const std::string &s, char delim, std::vector &elems) { + std::stringstream ss(s); + std::string item; + while (std::getline(ss, item, delim)) { + if (item.length() > 0) { + elems.push_back(item); + } + } + return elems; +} + +std::vector split(const std::string &s, char delim) { + std::vector elems; + split(s, delim, elems); + return elems; +} -- cgit v1.2.3