summaryrefslogtreecommitdiff
path: root/protocols/Twitter
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-06-29 17:17:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-06-29 17:17:10 +0000
commitb63e6266c23a782d0e5661111f350986aca7f3ff (patch)
treeff4fe95ac2a2d497d4d2177d44958b41d40153ff /protocols/Twitter
parent00fbddd5438d83614465a84bc81031df7c023fc0 (diff)
more old crap out
git-svn-id: http://svn.miranda-ng.org/main/trunk@17049 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Twitter')
-rw-r--r--protocols/Twitter/src/main.cpp6
-rw-r--r--protocols/Twitter/src/theme.cpp19
-rw-r--r--protocols/Twitter/src/theme.h1
3 files changed, 4 insertions, 22 deletions
diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp
index 6570b3b1ed..2995269fcd 100644
--- a/protocols/Twitter/src/main.cpp
+++ b/protocols/Twitter/src/main.cpp
@@ -83,8 +83,6 @@ static int protoUninit(PROTO_INTERFACE *proto)
return 0;
}
-static HANDLE g_hEvents[1];
-
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
@@ -109,9 +107,5 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
- UninitContactMenus();
- for (size_t i = 1; i < _countof(g_hEvents); i++)
- UnhookEvent(g_hEvents[i]);
-
return 0;
} \ No newline at end of file
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp
index 8470ea3bee..db2f27dcf7 100644
--- a/protocols/Twitter/src/theme.cpp
+++ b/protocols/Twitter/src/theme.cpp
@@ -55,10 +55,9 @@ HANDLE GetIconHandle(const char *name)
// Contact List menu stuff
static HGENMENU g_hMenuItems[2];
-static HANDLE g_hMenuEvts[3];
// Helper functions
-static TwitterProto * GetInstanceByHContact(MCONTACT hContact)
+static TwitterProto* GetInstanceByHContact(MCONTACT hContact)
{
char *proto = GetContactProto(hContact);
if (!proto)
@@ -88,7 +87,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
void InitContactMenus()
{
- g_hMenuEvts[0] = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
CMenuItem mi;
mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR;
@@ -98,26 +97,16 @@ void InitContactMenus()
mi.hIcolibItem = GetIconHandle("reply");
mi.name.t = LPGENT("Reply...");
mi.pszService = "Twitter/ReplyToTweet";
- g_hMenuEvts[1] = CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::ReplyToTweet>);
g_hMenuItems[0] = Menu_AddContactMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::ReplyToTweet>);
SET_UID(mi, 0x7f7e4c24, 0x821c, 0x450f, 0x93, 0x76, 0xbe, 0x65, 0xe9, 0x2f, 0xb6, 0xc2);
mi.position = -2000006000;
mi.hIcolibItem = GetIconHandle("homepage");
mi.name.t = LPGENT("Visit Homepage");
mi.pszService = "Twitter/VisitHomepage";
- g_hMenuEvts[2] = CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::VisitHomepage>);
g_hMenuItems[1] = Menu_AddContactMenuItem(&mi);
-}
-
-void UninitContactMenus()
-{
- for (size_t i = 0; i < _countof(g_hMenuItems); i++)
- Menu_RemoveItem(g_hMenuItems[i]);
-
- UnhookEvent(g_hMenuEvts[0]);
- for (size_t i = 1; i < _countof(g_hMenuEvts); i++)
- DestroyServiceFunction(g_hMenuEvts[i]);
+ CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::VisitHomepage>);
}
void ShowContactMenus(bool show)
diff --git a/protocols/Twitter/src/theme.h b/protocols/Twitter/src/theme.h
index 5c54d33f7d..5b5dcb7f1f 100644
--- a/protocols/Twitter/src/theme.h
+++ b/protocols/Twitter/src/theme.h
@@ -22,6 +22,5 @@ void InitIcons(void);
HANDLE GetIconHandle(const char *name);
void InitContactMenus(void);
-void UninitContactMenus(void);
void ShowContactMenus(bool show);
void TwitterInitSounds(void); \ No newline at end of file