summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp6
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/FMessage.h2
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp10
3 files changed, 1 insertions, 17 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp b/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp
index d5b5189b44..23461b30fc 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp
+++ b/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp
@@ -18,8 +18,6 @@ FMessage::FMessage() :
this->latitude = 0;
this->media_duration_seconds = 0;
this->media_size = 0;
- this->bindata = 0;
- this->bindata_len = 0;
}
FMessage::FMessage(const std::string &remote_jid, bool from_me, const std::string &id) :
@@ -31,8 +29,6 @@ FMessage::FMessage(const std::string &remote_jid, bool from_me, const std::strin
this->latitude = 0;
this->media_duration_seconds = 0;
this->media_size = 0;
- this->bindata = 0;
- this->bindata_len = 0;
}
std::string FMessage::getMessage_WA_Type_StrValue(unsigned char type)
@@ -59,8 +55,6 @@ std::string FMessage::getMessage_WA_Type_StrValue(unsigned char type)
FMessage::~FMessage()
{
- if (this->bindata != NULL)
- free(this->bindata);
}
Key::Key(const std::string& remote_jid, bool from_me, const std::string& id)
diff --git a/protocols/WhatsApp/src/WhatsAPI++/FMessage.h b/protocols/WhatsApp/src/WhatsAPI++/FMessage.h
index 7a7432c7f7..9b6a29b038 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/FMessage.h
+++ b/protocols/WhatsApp/src/WhatsAPI++/FMessage.h
@@ -39,8 +39,6 @@ struct FMessage
bool offline;
std::string media_url;
std::string media_name;
- unsigned char *bindata;
- size_t bindata_len;
long long media_size;
int media_duration_seconds;
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
index c08066426e..ffaeff52b9 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
+++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
@@ -413,19 +413,11 @@ void WAConnection::parseMessage(ProtocolTreeNode *messageNode) throw (WAExceptio
}
}
else {
- if (media->data == NULL || media->data->empty())
- return;
-
const string &encoding = media->getAttributeValue("encoding");
if (encoding.empty() || encoding == "text")
fmessage.data = media->getDataAsString();
- else {
+ else
fmessage.data = media->getAttributeValue("caption");
- if (media->data->size() > 0) {
- fmessage.bindata = (unsigned char*)malloc(fmessage.bindata_len = media->data->size());
- memcpy(fmessage.bindata, media->data->data(), fmessage.bindata_len);
- }
- }
}
if (m_pEventHandler != NULL)