diff options
-rw-r--r-- | plugins/AVS/src/contact_ava.cpp | 1 | ||||
-rw-r--r-- | plugins/AVS/src/services.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.h | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_vcard.cpp | 10 |
5 files changed, 11 insertions, 8 deletions
diff --git a/plugins/AVS/src/contact_ava.cpp b/plugins/AVS/src/contact_ava.cpp index 9a4b935a49..d2d8c08399 100644 --- a/plugins/AVS/src/contact_ava.cpp +++ b/plugins/AVS/src/contact_ava.cpp @@ -30,6 +30,7 @@ class CContactAvatarDlg : public CDlgBase INT_PTR OnAvatarChanged(UINT, WPARAM, LPARAM) { InvalidateRect(GetDlgItem(m_hwnd, IDC_PROTOPIC), nullptr, TRUE); + return 0; } INT_PTR OnDrawItem(UINT, WPARAM, LPARAM lParam) diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index d6fa1fdbb8..544e521b4e 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -167,7 +167,7 @@ INT_PTR SetAvatar(WPARAM hContact, LPARAM lParam) MakePathRelative(hContact, szFinalName);
// Fix cache
- ChangeAvatar(hContact, true);
+ ChangeAvatar(hContact, false, false, ProtoGetAvatarFileFormat(szFinalName));
return 1;
}
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 34f062c80f..bd74e32719 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1203,6 +1203,10 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g TiXmlElement *v = iq << XCHILDNS("vCard", JABBER_FEAT_VCARD_TEMP);
ppro->AppendPhotoToVcard(v, true, wszAvaPath.GetBuffer(), gch->si->hContact);
ppro->m_ThreadInfo->send(iq);
+
+ wchar_t szAvatarName[MAX_PATH];
+ ppro->GetAvatarFileName(gch->si->hContact, szAvatarName, _countof(szAvatarName));
+ CallService(MS_AV_SETAVATARW, gch->si->hContact, (LPARAM)szAvatarName);
}
break;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index ba0fc9cce5..2e5272c4e8 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -889,7 +889,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface int SendGetVcard(MCONTACT hContact);
void AppendVcardFromDB(TiXmlElement *n, char* tag, char* key);
- void AppendPhotoToVcard(TiXmlElement *n, bool bPhotoChanged, wchar_t *szPhotoFileName, MCONTACT hContact = 0);
+ void AppendPhotoToVcard(TiXmlElement *n, bool bPhotoChanged, const wchar_t *szPhotoFileName, MCONTACT hContact = 0);
void SetServerVcard(bool bPhotoChanged, wchar_t* szPhotoFileName);
void SaveVcardToDB(HWND hwndPage, int iPage);
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 5465e05c26..97de0efe7a 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -980,14 +980,12 @@ void CJabberProto::SetServerVcard(bool bPhotoChanged, wchar_t *szPhotoFileName) m_ThreadInfo->send(iq);
}
-void CJabberProto::AppendPhotoToVcard(TiXmlElement *v, bool bPhotoChanged, wchar_t *szPhotoFileName, MCONTACT hContact)
+void CJabberProto::AppendPhotoToVcard(TiXmlElement *v, bool bPhotoChanged, const wchar_t *szPhotoFileName, MCONTACT hContact)
{
- wchar_t szAvatarName[MAX_PATH], *szFileName;
+ wchar_t szAvatarName[MAX_PATH];
GetAvatarFileName(hContact, szAvatarName, _countof(szAvatarName));
- if (bPhotoChanged)
- szFileName = szPhotoFileName;
- else
- szFileName = szAvatarName;
+
+ const wchar_t *szFileName = (bPhotoChanged) ? szPhotoFileName : szAvatarName;
// Set photo element, also update the global jabberVcardPhotoFileName to reflect the update
debugLogW(L"Before update, file name = %s", szFileName);
|