summaryrefslogtreecommitdiff
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
parentda8d306b9d6fbe48f04f56d78be2058873f03dbc (diff)
obsolete compatibility code removed from AVS
-rw-r--r--include/delphi/m_avatars.inc255
-rw-r--r--include/m_avatars.h14
-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
16 files changed, 15 insertions, 291 deletions
diff --git a/include/delphi/m_avatars.inc b/include/delphi/m_avatars.inc
index 9f7b820ee0..fe2f0401b4 100644
--- a/include/delphi/m_avatars.inc
+++ b/include/delphi/m_avatars.inc
@@ -70,7 +70,6 @@ const
type
PavatarCacheEntry = ^TavatarCacheEntry;
TavatarCacheEntry = record
- cbSize : dword; // set to sizeof(struct)
hContact : TMCONTACT; // contacts handle, 0, if it is a protocol avatar
hbmPic : HBITMAP; // bitmap handle of the picture itself
dwFlags : dword; // see above for flag values
@@ -83,52 +82,6 @@ type
szFilename : array[0..MAX_PATH-1] of WideChar; // filename of the avatar (absolute path)
end;
-const
- AVDRQ_FALLBACKPROTO = $0001; // use the protocol picture as fallback (currently not used)
- AVDRQ_FAILIFNOTCACHED = $0002; // don't create a cache entry if it doesn't already
- // exist. (currently not working)
- AVDRQ_ROUNDEDCORNER = $0004; // draw with rounded corners
- AVDRQ_DRAWBORDER = $0008; // draw a border around the picture
- AVDRQ_PROTOPICT = $0010; // draw a protocol picture (if available).
- AVDRQ_HIDEBORDERONTRANSPARENCY = $0020; // hide border if bitmap has transparency
- AVDRQ_OWNPIC = $0040; // draw own avatar (szProto is valid, use "" for global avatar)
- AVDRQ_RESPECTHIDDEN = $0080; // don't draw images marked as hidden
- AVDRQ_DONTRESIZEIFSMALLER = $0100; // don't resize images that are smaller then the draw area
- AVDRQ_FORCEFASTALPHA = $0200; // force rendering with simple AlphaBlend (will use FI_Resample otherwise)
- AVDRQ_FORCEALPHA = $0400; // force with simple AlphaBlend (may use StretchBlt otherwise)
- AVDRQ_AERO = $0800; // draw on aero surface
-
-// request to draw a contacts picture. See MS_AV_DRAWAVATAR service description
-
-type
- PavatarDrawRequest = ^TavatarDrawRequest;
- TavatarDrawRequest = record
- cbSize : dword; // set this to sizeof(AVATARDRAWREQUEST) - mandatory,
- // service will return failure code if cbSize is wrong
- hContact : TMCONTACT; // the contact for which the avatar should be drawn.
- // set it to 0 to draw a protocol picture
- hTargetDC : HDC; // target device context
- rcDraw : TRECT; // target rectangle. The avatar will be centered
- // within the rectangle and scaled to fit.
- dwFlags : dword; // flags (see above for valid bitflags)
- dwReserved: dword; // for future use
- dwInternal: dword; // don't use it
- clrBorder : TCOLORREF; // color for the border (used with AVDRQ_DRAWBORDER)
- radius : byte; // radius (used with AVDRQ_ROUNDEDCORNER)
- alpha : byte; // alpha value for semi-transparent avatars (valid
- // values form 1 to 255, if it is set to 0 the
- // avatar won't be transparent.
- szProto : PAnsiChar; // only used when AVDRQ_PROTOPICT is set
- end;
-
-const
-// INITIAL_AVATARCACHESIZE = 300;
-// CACHE_GROWSTEP = 50;
- CACHE_BLOCKSIZE = 20;
-const
- AVS_MODULE :PAnsiChar = 'AVS_Settings'; // db settings module path
- PPICT_MODULE:PAnsiChar = 'AVS_ProtoPics'; // protocol pictures are saved here
-
{
obtain the bitmap handle of the avatar for the given contact
wParam = hContact
@@ -138,214 +91,8 @@ const
receive a notification via ME_AV_AVATARCHANGED
DONT modify the contents of the returned data structure
}
- MS_AV_GETAVATARBITMAP:PAnsiChar = 'SV_Avatars/GetAvatar';
-
- {
- obtain a avatar cache entry for one of my own avatars
- wParam = 0
- lParam = szProto (protocol for which we need to obtain the own avatar information)
- Use "" to global
- returns: pointer to a struct avatarCacheEntry *, NULL on failure
- DONT modify the contents of the returned data structure
- }
- MS_AV_GETMYAVATAR:PAnsiChar = 'SV_Avatars/GetMyAvatar';
-
- {
- protect the current contact picture from being overwritten by automatic
- avatar updates. Actually, it only backups the contact picture filename
- and will used the backuped version until the contact picture gets unlocked
- again. So this service does not disable avatar updates, but it "fakes"
- a locked contact picture to the users of the GetAvatar service.
-
- wParam = hContact
- lParam = 1 -> lock the avatar, lParam = 0 -> unlock
- }
- MS_AV_PROTECTAVATAR:PAnsiChar = 'SV_Avatars/ProtectAvatar';
-
- {
- set (and optionally protect) a local contact picture for the given hContact
-
- wParam = hContact
- lParam = either a full picture filename or NIL. If lParam = NIL, the service
- will open a file selection dialog.
- }
- MS_AV_SETAVATARW:PAnsiChar = 'SV_Avatars/SetAvatarW';
-
- {
- set a local picture for the given protocol
-
- wParam = (AnsiChar *) protocol name or NULL for all protocols
- lParam = either a full picture filename or NULL. If lParam == NULL, the service
- will open a file selection dialog.
- }
- MS_AV_SETMYAVATARW:PAnsiChar = 'SV_Avatars/SetMyAvatarW';
-
- {
- see if is possible to set the avatar for the expecified protocol
-
- wParam = (AnsiChar *) protocol name
- lParam = 0
- return = 1 if can set, 0 if can't
- }
- MS_AV_CANSETMYAVATAR:PAnsiChar = 'SV_Avatars/CanSetMyAvatar';
- {
- Call avatar option dialog for contact
- wParam = hContact
- }
- MS_AV_CONTACTOPTIONS:PAnsiChar = 'SV_Avatars/ContactOptions';
-
- {
- draw an avatar picture
-
- wParam = 0 (not used)
- lParam = pointer to AVATARDRAWREQUEST
- draw a contact picture to a destination device context. see description of
- the AVATARDRAWREQUEST structure for more information on how to use this
- service.
- return value: 0 -> failure, avatar probably not available, or not ready. The
- drawing service DOES schedule an avatar update so your plugin will be notified
- by the ME_AV_AVATARCHANGED event when the requested avatar is ready for use.
- 1 -> success. avatar was found and drawing should be ok.
- -1 -> global avatar is incosistent
- }
- MS_AV_DRAWAVATAR:PAnsiChar = 'SV_Avatars/Draw';
-// MS_AV_BLENDDRAWAVATAR = 'SV_Avatars/BlendDraw';
-
- {
- fired when the contacts avatar changes
- wParam = hContact
- lParam = struct avatarCacheEntry *cacheEntry
- the event CAN pass a NULL pointer in lParam which means that the avatar has
- changed, but is no longer valid (happens, when a contact removes his avatar,
- for example).
- DONT DESTROY the bitmap handle passed in the struct avatarCacheEntry *
-
- It is also possible that this event passes 0 as wParam (hContact), in which case,
- a protocol picture (pseudo - avatar) has been changed.
- }
- ME_AV_AVATARCHANGED:PAnsiChar = 'SV_Avatars/AvatarChanged';
-
-type
- TContactAvatarChangedNotificationW = record
- cbSize :int; // sizeof()
- hContact:TMCONTACT; // this might have to be set by the caller too
- format :int; // PA_FORMAT_*
- filename:array [0..MAX_PATH-1] of WideChar; // full path to filename which contains the avatar
- hash :array [0..127] of WideChar; // avatar hash (always an empty string by now)
- end;
-
- TContactAvatarChangedNotification = record
- cbSize :int; // sizeof()
- hContact:TMCONTACT; // this might have to be set by the caller too
- format :int; // PA_FORMAT_*
- filename:array [0..MAX_PATH-1] of AnsiChar; // full path to filename which contains the avatar
- hash :array [0..127] of AnsiChar; // avatar hash (always an empty string by now)
- end;
const
- {
- fired when the contacts avatar is changed by the contact
- wParam = hContact
- lParam = struct CONTACTAVATARCHANGEDNOTIFICATION *cacn
- the event CAN pass a NULL pointer in lParam which means that the contact deleted its avatar
- }
- ME_AV_CONTACTAVATARCHANGED:PAnsiChar = 'SV_Avatars/ContactAvatarChanged';
-
- {
- fired when one of our own avatars was changed
- wParam = szProto (protocol for which a new avatar was set)
- lParam = AVATARCACHEENTRY *ace (new cache entry,
- NULL if the new avatar is not valid)
- }
- ME_AV_MYAVATARCHANGED:PAnsiChar = 'SV_Avatars/MyAvatarChanged';
-
- {
- Service to be called by protocols to report an avatar has changed. Some avatar changes
- can be detected automatically, but some not (by now only Skype ones)
- wParam = (AnsiChar *)szProto (protocol for which a new avatar was set)
- lParam = 0
- }
- MS_AV_REPORTMYAVATARCHANGED:PAnsiChar = 'SV_Avatars/ReportMyAvatarChanged';
-
-{
- * flags for internal use ONLY
-}
-
- AVH_MUSTNOTIFY = 4; // node->dwFlags (loader thread must notify avatar
- // history about change/delete event)
- AVS_DELETENODEFOREVER = 8;
-
-// Protocol services //////////////////////////////////////////////////////////////////////
-
-{
- wParam=0
- lParam=(const AnsiChar *)Avatar file name or NULL to remove the avatar
- return=0 for sucess
-}
- PS_SETMYAVATAR = '/SetMyAvatar';
- PS_SETMYAVATARW = '/SetMyAvatarW';
-
-{
- wParam=Buffer to file name
- lParam=(int)Buffer size
- return=0 for sucess
-}
- PS_GETMYAVATAR = '/GetMyAvatar';
- PS_GETMYAVATARW = '/GetMyAvatarW';
-
- PIP_NONE = 0;
- PIP_SQUARE = 1;
-
-// Avatar image max size
-// lParam = (POINT*) maxSize (use -1 for no max)
-// return 0 for success
- AF_MAXSIZE = 1;
-
-// Avatar image proportion
-// lParam = 0
-// return or of PIP_*
- AF_PROPORTION = 2;
-
-// Avatar format
-// lParam = PA_FORMAT_*
-// return = 1 (supported) or 0 (not supported)
- AF_FORMATSUPPORTED = 3;
-
-// Avatars are enabled for protocol?
-// lParam = 0
-// return = 1 (avatars ready) or 0 (disabled)
- AF_ENABLED = 4;
-
-// This protocol don't need delays for fetching contact avatars
-// lParam = 0
-// return = 1 (don't need) or 0 (need)
- AF_DONTNEEDDELAYS = 5;
-
-// Avatar file max size
-// return size in bytes (0 for no limit)
- AF_MAXFILESIZE = 6;
-
-// The amount of time avs should wait after a download avatar failed for a contact
-// lParam = 0
-// return = the time, in ms
- AF_DELAYAFTERFAIL = 7;
-
-// Fetching avatars is allowed when protocol's status is invisible
-// lParam = 0
-// return = 1 (allowed) or 0 (depending on our protocol status mode)
- AF_FETCHIFPROTONOTVISIBLE = 8;
-
-// Fetching avatars is allowed when contact is in offline status
-// lParam = 0
-// return = 1 (allowed) or 0 (depending on remote contact status mode)
- AF_FETCHIFCONTACTOFFLINE = 9;
-
-{
- Query avatar caps for a protocol
- wParam = One of AF_*
- lParam = See descr of each AF_*
- return = See descr of each AF_*. Return 0 by default
-}
- PS_GETAVATARCAPS = '/GetAvatarCaps';
+ MS_AV_GETAVATARBITMAP:PAnsiChar = 'SV_Avatars/GetAvatar';
{$ENDIF}
diff --git a/include/m_avatars.h b/include/m_avatars.h
index d634802bc0..d27f56e0e4 100644
--- a/include/m_avatars.h
+++ b/include/m_avatars.h
@@ -72,7 +72,6 @@ unless AF_FETCHIFPROTONOTVISIBLE is set.
struct AVATARCACHEENTRY
{
- DWORD cbSize; // set to sizeof(struct)
MCONTACT hContact; // contacts handle, 0, if it is a protocol avatar
HBITMAP hbmPic; // bitmap handle of the picutre itself
DWORD dwFlags; // see above for flag values
@@ -81,7 +80,7 @@ struct AVATARCACHEENTRY
// use it whenever they access the avatar. may be used in the future
// to implement cache expiration
LPVOID lpDIBSection; // unused field
- wchar_t szFilename[MAX_PATH]; // filename of the avatar (absolute path)
+ wchar_t szFilename[MAX_PATH]; // filename of the avatar (absolute path)
};
#define AVDRQ_FALLBACKPROTO 0x0001 // use the protocol picture as fallback (currently not used)
@@ -90,18 +89,17 @@ struct AVATARCACHEENTRY
#define AVDRQ_DRAWBORDER 0x0008 // draw a border around the picture
#define AVDRQ_PROTOPICT 0x0010 // draw a protocol picture (if available).
#define AVDRQ_HIDEBORDERONTRANSPARENCY 0x0020 // hide border if bitmap has transparency
-#define AVDRQ_OWNPIC 0x0040 // draw own avatar (szProto is valid - use "" for global avatar)
+#define AVDRQ_OWNPIC 0x0040 // draw own avatar (szProto is valid - use "" for global avatar)
#define AVDRQ_RESPECTHIDDEN 0x0080 // don't draw images marked as hidden
#define AVDRQ_DONTRESIZEIFSMALLER 0x0100 // don't resize images that are smaller then the draw area
#define AVDRQ_FORCEFASTALPHA 0x0200 // force rendering with simple AlphaBlend (will use FI_Resample otherwise)
#define AVDRQ_FORCEALPHA 0x0400 // force with simple AlphaBlend (may use StretchBlt otherwise)
-#define AVDRQ_AERO 0x0800 // draw on aero surface
+#define AVDRQ_AERO 0x0800 // draw on aero surface
// request to draw a contacts picture. See MS_AV_DRAWAVATAR service description
-typedef struct _avatarDrawRequest
+struct AVATARDRAWREQUEST
{
- DWORD cbSize; // set this to sizeof(AVATARDRAWREQUEST) - mandatory, service will return failure code if cbSize is wrong
MCONTACT hContact; // the contact for which the avatar should be drawn. set it to 0 to draw a protocol picture
HDC hTargetDC; // target device context
RECT rcDraw; // target rectangle. The avatar will be centered within the rectangle and scaled to fit.
@@ -113,8 +111,7 @@ typedef struct _avatarDrawRequest
UCHAR alpha; // alpha value for semi-transparent avatars (valid values form 1 to 255, if it is set to 0
// the avatar won't be transparent.
char *szProto; // only used when AVDRQ_PROTOPICT or AVDRQ_OWNPIC is set
-}
- AVATARDRAWREQUEST;
+};
#define CACHE_BLOCKSIZE 20
@@ -210,7 +207,6 @@ typedef struct _avatarDrawRequest
struct CONTACTAVATARCHANGEDNOTIFICATION
{
- int cbSize; // sizeof()
MCONTACT hContact; // this might have to be set by the caller too
int format; // PA_FORMAT_*
wchar_t filename[MAX_PATH]; // full path to filename which contains the avatar
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;