diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-30 08:48:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-30 08:48:02 +0000 |
commit | a7531b2364ca31b93498ce6cd0da1a3fa16738f7 (patch) | |
tree | cb980d0159910b06c54fca1b740843d1872eac4c /protocols | |
parent | eaa183e14a412210dac9320cdaa2114c555a24ac (diff) |
idea of saving previews considered bad
git-svn-id: http://svn.miranda-ng.org/main/trunk@11956 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/WhatsApp/src/messages.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
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("]: "));
|