diff options
author | George Hazan <ghazan@miranda.im> | 2019-08-16 21:05:49 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-08-16 21:05:49 +0300 |
commit | 93a5c7db40cfc2e08196bfdbb37620ed3318f2a4 (patch) | |
tree | 8c5788d979cc364684411d8755effeaff0c0af5f | |
parent | bd351ba932b5954475895559b4f6ab485752bc1d (diff) |
ICQ-WIM: fix for sending empty queries to http server
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 27 |
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) |