summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_thread.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-10-22 19:50:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-10-22 19:50:54 +0300
commit9548530c9e9c7bc1cbcf1c2c97008b217865fb4d (patch)
tree8ca6e9d9bcc4e764623c6aac793844ccbeba435e /protocols/JabberG/src/jabber_thread.cpp
parent12d0e94244510f84d210dfeb07959978f799bdd0 (diff)
fixes #2103 (Jabber: we should ignore AvatarHash if file does not exist)
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 29e11ee2cc..04c1aaad32 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1643,12 +1643,17 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info)
auto *szPhoto = XmlGetChildText(xNode, "photo");
if (szPhoto && !bHasAvatar) {
if (mir_strlen(szPhoto)) {
+ // no file - no saved hash
+ wchar_t tszFileName[MAX_PATH];
+ GetAvatarFileName(hContact, tszFileName, _countof(tszFileName));
+ if (::_waccess(tszFileName, 0) != 0)
+ delSetting(hContact, "AvatarHash");
+
bHasAvatar = true;
ptrA saved(getStringA(hContact, "AvatarHash"));
if (saved == nullptr || mir_strcmp(saved, szPhoto)) {
debugLogA("Avatar was changed, reloading");
- setString(hContact, "AvatarHash", szPhoto);
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, nullptr, 0);
+ SendGetVcard(hContact);
continue;
}
}