summaryrefslogtreecommitdiff
path: root/plugins/AVS
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-16 21:47:46 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-16 21:47:46 +0300
commitf1195d51ea8094492fcf63a301f2cdc9d1173d6c (patch)
treedcecf42303502d0197d81bf1cbc49769a9534e15 /plugins/AVS
parent5084152e23d52311696ad488e61ca6fd13d1df55 (diff)
minor code cleaning
Diffstat (limited to 'plugins/AVS')
-rw-r--r--plugins/AVS/src/main.cpp58
-rw-r--r--plugins/AVS/src/poll.cpp1
2 files changed, 28 insertions, 31 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp
index d8bfc89206..c1d80cb239 100644
--- a/plugins/AVS/src/main.cpp
+++ b/plugins/AVS/src/main.cpp
@@ -41,6 +41,29 @@ HANDLE hEventChanged, hEventContactAvatarChanged, hMyAvatarChanged;
void InitServices();
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ // {E00F1643-263C-4599-B84B-053E5C511D29}
+{ 0xe00f1643, 0x263c, 0x4599,{ 0xb8, 0x4b, 0x5, 0x3e, 0x5c, 0x51, 0x1d, 0x29 } }
+};
+
+extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int ComparePicture(const protoPicCacheEntry *p1, const protoPicCacheEntry *p2)
{
if (p1->cacheType != p2->cacheType)
@@ -335,8 +358,12 @@ static int ModulesLoaded(WPARAM, LPARAM)
return 0;
}
-static int LoadAvatarModule()
+extern "C" int __declspec(dllexport) Load(void)
{
+ mir_getLP(&pluginInfoEx);
+
+ LoadACC();
+
hShutdownEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
HookEvent(ME_OPT_INITIALISE, OptInit);
@@ -361,35 +388,6 @@ static int LoadAvatarModule()
/////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfoEx = {
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- // {E00F1643-263C-4599-B84B-053E5C511D29}
-{
- 0xe00f1643, 0x263c, 0x4599,{ 0xb8, 0x4b, 0x5, 0x3e, 0x5c, 0x51, 0x1d, 0x29 } }
-};
-
-extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfoEx;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-extern "C" int __declspec(dllexport) Load(void)
-{
- mir_getLP(&pluginInfoEx);
-
- LoadACC();
- return LoadAvatarModule();
-}
-
extern "C" int __declspec(dllexport) Unload(void)
{
UninitPolls();
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp
index 60f9480438..c004765f03 100644
--- a/plugins/AVS/src/poll.cpp
+++ b/plugins/AVS/src/poll.cpp
@@ -42,7 +42,6 @@ ACKRESULT_STATUS. This thread only requests the avatar (and maybe add it to the
static void RequestThread(void *vParam);
-extern HANDLE hShutdownEvent;
extern void MakePathRelative(MCONTACT hContact, wchar_t *path);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto);