summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-10 13:11:16 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-10 13:11:16 +0300
commit30aa26c864fa09b974e3c223ccf907421ebc0759 (patch)
tree242d5635daec062b22a166c1047810ae4b54a8bc /plugins
parentda8d306b9d6fbe48f04f56d78be2058873f03dbc (diff)
obsolete compatibility code removed from AVS
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AVS/src/acc.cpp1
-rw-r--r--plugins/AVS/src/cache.cpp1
-rw-r--r--plugins/AVS/src/options.cpp2
-rw-r--r--plugins/AVS/src/poll.cpp1
-rw-r--r--plugins/AVS/src/services.cpp3
-rw-r--r--plugins/AVS/src/utils.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp2
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp2
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp2
-rw-r--r--plugins/ExternalAPI/m_notify.h4
-rw-r--r--plugins/FavContacts/src/menu.cpp1
-rw-r--r--plugins/IEView/src/TemplateHTMLBuilder.cpp8
-rw-r--r--plugins/UserInfoEx/src/svc_avatar.cpp6
-rw-r--r--plugins/YAPP/src/popwin.cpp3
14 files changed, 9 insertions, 28 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp
index 99beff22c7..5d7bb35503 100644
--- a/plugins/AVS/src/acc.cpp
+++ b/plugins/AVS/src/acc.cpp
@@ -573,7 +573,6 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
else {
// Draw avatar
AVATARDRAWREQUEST avdrq = { 0 };
- avdrq.cbSize = sizeof(avdrq);
avdrq.rcDraw = rc;
avdrq.hContact = data->hContact;
avdrq.szProto = data->proto;
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp
index 160f1a3d1b..33e6c877c3 100644
--- a/plugins/AVS/src/cache.cpp
+++ b/plugins/AVS/src/cache.cpp
@@ -126,7 +126,6 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace)
node->dwFlags &= ~AVH_MUSTNOTIFY;
if (node->szFilename[0] != '\0') {
CONTACTAVATARCHANGEDNOTIFICATION cacn = {};
- cacn.cbSize = sizeof(CONTACTAVATARCHANGEDNOTIFICATION);
cacn.hContact = hContact;
cacn.format = node->pa_format;
wcsncpy_s(cacn.filename, node->szFilename, _TRUNCATE);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index e02a04cbd8..55de5ed96a 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -347,7 +347,6 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->CtlType == ODT_BUTTON && dis->CtlID == IDC_PROTOPIC) {
AVATARDRAWREQUEST avdrq = { 0 };
- avdrq.cbSize = sizeof(avdrq);
avdrq.hTargetDC = dis->hDC;
avdrq.dwFlags |= AVDRQ_PROTOPICT;
avdrq.szProto = (g_selectedProto) ? g_selectedProto->szProtoname : 0;
@@ -631,7 +630,6 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
FillRect(dis->hDC, &avdrq.rcDraw, GetSysColorBrush(COLOR_BTNFACE));
avdrq.hContact = hContact;
- avdrq.cbSize = sizeof(avdrq);
avdrq.hTargetDC = dis->hDC;
avdrq.dwFlags |= AVDRQ_DRAWBORDER;
avdrq.clrBorder = GetSysColor(COLOR_BTNTEXT);
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp
index 03135f35d2..471ca4a41f 100644
--- a/plugins/AVS/src/poll.cpp
+++ b/plugins/AVS/src/poll.cpp
@@ -43,7 +43,6 @@ ACKRESULT_STATUS. This thread only requests the avatar (and maybe add it to the
static void RequestThread(void *vParam);
extern HANDLE hShutdownEvent;
-extern int DeleteAvatar(MCONTACT hContact);
extern void MakePathRelative(MCONTACT hContact, wchar_t *path);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto);
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp
index de0710e82a..c350ebd18a 100644
--- a/plugins/AVS/src/services.cpp
+++ b/plugins/AVS/src/services.cpp
@@ -695,9 +695,6 @@ INT_PTR DrawAvatarPicture(WPARAM, LPARAM lParam)
if (r == nullptr || IsBadReadPtr((void *)r, sizeof(AVATARDRAWREQUEST)))
return 0;
- if (r->cbSize != sizeof(AVATARDRAWREQUEST))
- return 0;
-
if (r->dwFlags & AVDRQ_PROTOPICT) {
if (r->szProto == nullptr)
return 0;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp
index 0fcfc88c4c..9ecca88089 100644
--- a/plugins/AVS/src/utils.cpp
+++ b/plugins/AVS/src/utils.cpp
@@ -157,7 +157,6 @@ int CreateAvatarInCache(MCONTACT hContact, AVATARCACHEENTRY *ace, const char *sz
BITMAP bminfo;
GetObject(ace->hbmPic, sizeof(bminfo), &bminfo);
- ace->cbSize = sizeof(AVATARCACHEENTRY);
ace->dwFlags = AVS_BITMAP_VALID;
if (hContact != NULL && db_get_b(hContact, "ContactPhoto", "Hidden", 0))
ace->dwFlags |= AVS_HIDEONCLIST;
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index 2cf812b360..060e141c5c 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -719,7 +719,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0)) {
contact->avatar_data = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, contact->hContact, 0);
- if (contact->avatar_data == nullptr || contact->avatar_data->cbSize != sizeof(AVATARCACHEENTRY) || contact->avatar_data->dwFlags == AVS_BITMAP_EXPIRED)
+ if (contact->avatar_data == nullptr || contact->avatar_data->dwFlags == AVS_BITMAP_EXPIRED)
contact->avatar_data = nullptr;
if (contact->avatar_data != nullptr)
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index 82a98901a8..906568a206 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -85,8 +85,6 @@ void LoadAvatarForContact(ClcContact *p)
p->ace = nullptr;
if (cfg::dat.bAvatarServiceAvail && (p->cFlags & ECF_AVATAR) && (!cfg::dat.bNoOfflineAvatars || p->wStatus != ID_STATUS_OFFLINE)) {
p->ace = (struct AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)p->hContact, 0);
- if (p->ace != nullptr && p->ace->cbSize != sizeof(struct AVATARCACHEENTRY))
- p->ace = nullptr;
if (p->ace != nullptr)
p->ace->t_lastAccess = cfg::dat.t_now;
}
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index 4b37de1d13..6c013e5248 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -203,7 +203,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int
if (!cfg::dat.bAvatarServiceAvail || dat->bisEmbedded)
return 0;
- if (contact->ace != nullptr && contact->ace->cbSize == sizeof(struct AVATARCACHEENTRY)) {
+ if (contact->ace != nullptr) {
if (contact->ace->dwFlags & AVS_HIDEONCLIST)
return (cfg::dat.dwFlags & CLUI_FRAME_ALWAYSALIGNNICK) ? avatar_size + 2 : 0;
diff --git a/plugins/ExternalAPI/m_notify.h b/plugins/ExternalAPI/m_notify.h
index e286cd4c13..fe15599a96 100644
--- a/plugins/ExternalAPI/m_notify.h
+++ b/plugins/ExternalAPI/m_notify.h
@@ -111,14 +111,14 @@ typedef struct tagMNNOTIFYLINK
if (dbv.type != DBVT_DWORD) return defValue;
return dbv.dVal;
}
- static __inline const char *MNotifyGetString(HANDLE notifyORtype, const char *name, const char *defValue)
+ static __inline const char* MNotifyGetString(HANDLE notifyORtype, const char *name, const char *defValue)
{
DBVARIANT dbv;
MNotifyGet(notifyORtype, name, &dbv);
if (dbv.type != DBVT_ASCIIZ) return defValue;
return dbv.pszVal;
}
- static __inline const WCHAR *MNotifyGetWString(HANDLE notifyORtype, const char *name, const WCHAR *defValue)
+ static __inline const WCHAR* MNotifyGetWString(HANDLE notifyORtype, const char *name, const WCHAR *defValue)
{
DBVARIANT dbv;
MNotifyGet(notifyORtype, name, &dbv);
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp
index 04335bf433..4e6bab443a 100644
--- a/plugins/FavContacts/src/menu.cpp
+++ b/plugins/FavContacts/src/menu.cpp
@@ -271,7 +271,6 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = nullp
avatarWidth = (lpdis->rcItem.bottom - lpdis->rcItem.top) * ace->bmWidth / ace->bmHeight;
AVATARDRAWREQUEST avdr = { 0 };
- avdr.cbSize = sizeof(avdr);
avdr.hContact = hContact;
avdr.hTargetDC = hdcTemp;
avdr.rcDraw = lpdis->rcItem;
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp
index 9f7ebb07a7..b0c63ca4cb 100644
--- a/plugins/IEView/src/TemplateHTMLBuilder.cpp
+++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp
@@ -45,12 +45,8 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto)
else
ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
- if (ace != nullptr) {
- if (ace->cbSize == sizeof(AVATARCACHEENTRY))
- result = ace->szFilename;
- else // compatibility: in M0.9 it will always be char*
- MultiByteToWideChar(CP_ACP, 0, (char*)ace->szFilename, -1, tmpPath, _countof(tmpPath));
- }
+ if (ace != nullptr)
+ result = ace->szFilename;
}
if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
if (mir_wstrlen(dbv.ptszVal) > 0) {
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp
index 6fe5421881..6fab5abbbb 100644
--- a/plugins/UserInfoEx/src/svc_avatar.cpp
+++ b/plugins/UserInfoEx/src/svc_avatar.cpp
@@ -79,10 +79,8 @@ namespace NServices
if (hContact) {
// check valid parameters
if (ace) {
- if (// check for correct structure
- ace->cbSize == sizeof(AVATARCACHEENTRY) &&
- // set zodiac as avatar either if the desired avatar is invalid or a general protocol picture
- ((ace->dwFlags & AVS_PROTOPIC) || !(ace->dwFlags & AVS_BITMAP_VALID))) {
+ // set zodiac as avatar either if the desired avatar is invalid or a general protocol picture
+ if (((ace->dwFlags & AVS_PROTOPIC) || !(ace->dwFlags & AVS_BITMAP_VALID))) {
if (!db_get_b(hContact, "ContactPhoto", "IsZodiac", 0))
SetZodiacAvatar(hContact);
}
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp
index dce7e7cf1c..ee8a674678 100644
--- a/plugins/YAPP/src/popwin.cpp
+++ b/plugins/YAPP/src/popwin.cpp
@@ -413,8 +413,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
avr.bottom = avr.top + pwd->real_av_height;
- AVATARDRAWREQUEST adr = {0};
- adr.cbSize = sizeof(adr);
+ AVATARDRAWREQUEST adr = {};
adr.hContact = pd->hContact;
adr.hTargetDC = ps.hdc;
adr.rcDraw = avr;