From a7531b2364ca31b93498ce6cd0da1a3fa16738f7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 30 Jan 2015 08:48:02 +0000 Subject: idea of saving previews considered bad git-svn-id: http://svn.miranda-ng.org/main/trunk@11956 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/messages.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'protocols/WhatsApp/src') diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index 36c4bcc1da..d5b1325f5f 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -12,27 +12,10 @@ void WhatsAppProto::onMessageForMe(FMessage *pMsg, bool paramBoolean) bool isChatRoom = !pMsg->remote_resource.empty(); std::string msg; - if (!pMsg->media_url.empty()) { + if (!pMsg->media_url.empty()) msg = pMsg->media_url; - if (pMsg->bindata_len) { - TCHAR tszFilePath[MAX_PATH], tszFileName[MAX_PATH]; - GetTempPath(_countof(tszFilePath), tszFilePath); - mir_sntprintf(tszFileName, _countof(tszFileName), _T("%s\\%s.jpg"), tszFilePath, _A2T(pMsg->media_name.c_str())); - FILE *out = _tfopen(tszFileName, _T("wb")); - if (out != NULL) { - fwrite(pMsg->bindata, 1, pMsg->bindata_len, out); - fclose(out); - - std::string szFileName((const char*)_T2A(tszFileName)); - std::replace(szFileName.begin(), szFileName.end(), '\\', '/'); - std::replace(szFileName.begin(), szFileName.end(), ' ', '+'); - - msg.append("\nfile://"); - msg += szFileName; - } - } - } - else msg = pMsg->data; + else + msg = pMsg->data; if (isChatRoom) msg.insert(0, std::string("[").append(pMsg->notifyname).append("]: ")); -- cgit v1.2.3