diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-15 18:39:49 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-15 18:39:49 +0300 |
commit | 7518561eddbe1349e145654e906321ce9808832b (patch) | |
tree | 58dc92721d71989dc54caa1c4edd9d05f3da411e /protocols/JabberG | |
parent | 7b24bd112ee968f845205502227f25218d40229a (diff) |
minor addition to the previous commit
Diffstat (limited to 'protocols/JabberG')
-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 |
3 files changed, 9 insertions, 7 deletions
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);
|