diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-01 20:40:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-01 20:40:05 +0000 |
commit | acd4daf132c8ff3b05df7615e95f60be2fb82ddb (patch) | |
tree | ff5836cfc26ab245a356d15c90d36ece29f07189 /protocols/JabberG/src | |
parent | 9de7eaca48475e8e5c7f04b72451983ace0ccee5 (diff) |
various quirks with PROTO_AVATAR_INFORMATION declarations
git-svn-id: http://svn.miranda-ng.org/main/trunk@13965 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 14 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_svc.cpp | 20 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_util.cpp | 26 |
3 files changed, 30 insertions, 30 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 72eb87d11a..eaa7edc593 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -1401,9 +1401,9 @@ LBL_ErrFormat: else if ((pictureType = ProtoGetBufferFormat(body, 0)) == PA_FORMAT_UNKNOWN)
goto LBL_ErrFormat;
- PROTO_AVATAR_INFORMATION AI;
- AI.format = pictureType;
- AI.hContact = hContact;
+ PROTO_AVATAR_INFORMATION ai;
+ ai.format = pictureType;
+ ai.hContact = hContact;
TCHAR tszFileName[MAX_PATH];
if (getByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
@@ -1420,7 +1420,7 @@ LBL_ErrFormat: mir_sha1_finish(&sha, digest);
GetAvatarFileName(hContact, tszFileName, SIZEOF(tszFileName));
- _tcsncpy_s(AI.filename, tszFileName, _TRUNCATE);
+ _tcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
FILE *out = _tfopen(tszFileName, _T("wb"));
if (out != NULL) {
@@ -1429,10 +1429,10 @@ LBL_ErrFormat: char buffer[41];
setString(hContact, "AvatarSaved", bin2hex(digest, sizeof(digest), buffer));
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, HANDLE(&AI), NULL);
- debugLog(_T("Broadcast new avatar: %s"),AI.filename);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, HANDLE(&ai), NULL);
+ debugLog(_T("Broadcast new avatar: %s"),ai.filename);
}
- else ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, HANDLE(&AI), NULL);
+ else ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, HANDLE(&ai), NULL);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 45413a7e89..916a3ce87c 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -121,34 +121,34 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) if (!m_options.EnableAvatars)
return GAIR_NOAVATAR;
- PROTO_AVATAR_INFORMATION* AI = (PROTO_AVATAR_INFORMATION*)lParam;
+ PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*)lParam;
- ptrA szHashValue( getStringA(AI->hContact, "AvatarHash"));
+ ptrA szHashValue( getStringA(pai->hContact, "AvatarHash"));
if (szHashValue == NULL) {
debugLogA("No avatar");
return GAIR_NOAVATAR;
}
TCHAR tszFileName[MAX_PATH];
- GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName));
- _tcsncpy_s(AI->filename, tszFileName, _TRUNCATE);
+ GetAvatarFileName(pai->hContact, tszFileName, SIZEOF(tszFileName));
+ _tcsncpy_s(pai->filename, tszFileName, _TRUNCATE);
- AI->format = (AI->hContact == NULL) ? PA_FORMAT_PNG : getByte(AI->hContact, "AvatarType", 0);
+ pai->format = (pai->hContact == NULL) ? PA_FORMAT_PNG : getByte(pai->hContact, "AvatarType", 0);
- if (::_taccess(AI->filename, 0) == 0) {
- ptrA szSavedHash( getStringA(AI->hContact, "AvatarSaved"));
+ if (::_taccess(pai->filename, 0) == 0) {
+ ptrA szSavedHash( getStringA(pai->hContact, "AvatarSaved"));
if (szSavedHash != NULL && !mir_strcmp(szSavedHash, szHashValue)) {
debugLogA("Avatar is Ok: %s == %s", szSavedHash, szHashValue);
return GAIR_SUCCESS;
}
}
- if ((wParam & GAIF_FORCE) != 0 && AI->hContact != NULL && m_bJabberOnline) {
- ptrT tszJid( getTStringA(AI->hContact, "jid"));
+ if ((wParam & GAIF_FORCE) != 0 && pai->hContact != NULL && m_bJabberOnline) {
+ ptrT tszJid( getTStringA(pai->hContact, "jid"));
if (tszJid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, tszJid);
if (item != NULL) {
- BOOL isXVcard = getByte(AI->hContact, "AvatarXVcard", 0);
+ BOOL isXVcard = getByte(pai->hContact, "AvatarXVcard", 0);
TCHAR szJid[JABBER_MAX_JID_LEN]; szJid[0] = 0;
if (item->arResources.getCount() != NULL && !isXVcard)
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index a83d136e8e..b6a142b90f 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -935,17 +935,17 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param) if (res->resultCode == 200 && res->dataLength) {
int pictureType = ProtoGetBufferFormat(res->pData);
if (pictureType != PA_FORMAT_UNKNOWN) {
- PROTO_AVATAR_INFORMATION AI;
- AI.format = pictureType;
- AI.hContact = avs[i].hContact;
+ PROTO_AVATAR_INFORMATION ai;
+ ai.format = pictureType;
+ ai.hContact = avs[i].hContact;
- if (getByte(AI.hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
+ if (getByte(ai.hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
TCHAR tszFileName[MAX_PATH];
- GetAvatarFileName(AI.hContact, tszFileName, SIZEOF(tszFileName));
+ GetAvatarFileName(ai.hContact, tszFileName, SIZEOF(tszFileName));
DeleteFile(tszFileName);
}
- setByte(AI.hContact, "AvatarType", pictureType);
+ setByte(ai.hContact, "AvatarType", pictureType);
char buffer[2 * MIR_SHA1_HASH_SIZE + 1];
BYTE digest[MIR_SHA1_HASH_SIZE];
@@ -955,20 +955,20 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param) mir_sha1_finish(&sha, digest);
bin2hex(digest, sizeof(digest), buffer);
- ptrA cmpsha(getStringA(AI.hContact, "AvatarSaved"));
+ ptrA cmpsha(getStringA(ai.hContact, "AvatarSaved"));
if (cmpsha == NULL || strnicmp(cmpsha, buffer, sizeof(buffer))) {
TCHAR tszFileName[MAX_PATH];
- GetAvatarFileName(AI.hContact, tszFileName, SIZEOF(tszFileName));
- _tcsncpy_s(AI.filename, tszFileName, _TRUNCATE);
+ GetAvatarFileName(ai.hContact, tszFileName, SIZEOF(tszFileName));
+ _tcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
FILE* out = _tfopen(tszFileName, _T("wb"));
if (out != NULL) {
fwrite(res->pData, res->dataLength, 1, out);
fclose(out);
- setString(AI.hContact, "AvatarSaved", buffer);
- ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
- debugLog(_T("Broadcast new avatar: %s"), AI.filename);
+ setString(ai.hContact, "AvatarSaved", buffer);
+ ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai, 0);
+ debugLog(_T("Broadcast new avatar: %s"), ai.filename);
}
- else ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
+ else ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai, 0);
}
}
}
|