summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-08-16 21:05:49 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-08-16 21:05:49 +0300
commit93a5c7db40cfc2e08196bfdbb37620ed3318f2a4 (patch)
tree8c5788d979cc364684411d8755effeaff0c0af5f
parentbd351ba932b5954475895559b4f6ab485752bc1d (diff)
ICQ-WIM: fix for sending empty queries to http server
-rw-r--r--protocols/ICQ-WIM/src/server.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index 2bc5723a80..6a7ac4a7c5 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -25,20 +25,25 @@
void CIcqProto::CheckAvatarChange(MCONTACT hContact, const JSONNode &ev)
{
CMStringW wszIconId(ev["iconId"].as_mstring());
- CMStringW oldIconID(getMStringW(hContact, "IconId"));
- if (wszIconId == oldIconID) {
- wchar_t wszFullName[MAX_PATH];
- GetAvatarFileName(hContact, wszFullName, _countof(wszFullName));
- if (_waccess(wszFullName, 0) == 0)
- return;
- }
+ if (!wszIconId.IsEmpty()) {
+ CMStringW oldIconID(getMStringW(hContact, "IconId"));
+ if (wszIconId == oldIconID) {
+ wchar_t wszFullName[MAX_PATH];
+ GetAvatarFileName(hContact, wszFullName, _countof(wszFullName));
+ if (_waccess(wszFullName, 0) == 0)
+ return;
+ }
- setWString(hContact, "IconId", wszIconId);
+ setWString(hContact, "IconId", wszIconId);
+ }
+ else delSetting(hContact, "IconId");
CMStringA szUrl(ev["buddyIcon"].as_mstring());
- auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, szUrl, &CIcqProto::OnReceiveAvatar);
- pReq->hContact = hContact;
- Push(pReq);
+ if (!szUrl.IsEmpty()) {
+ auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, szUrl, &CIcqProto::OnReceiveAvatar);
+ pReq->hContact = hContact;
+ Push(pReq);
+ }
}
void CIcqProto::CheckLastId(MCONTACT hContact, const JSONNode &ev)