diff options
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.cpp | 10 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.h | 1 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/links.cpp | 36 |
3 files changed, 8 insertions, 39 deletions
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 0930378b6d..1b70719699 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -195,15 +195,6 @@ static int gg_modulesloaded(WPARAM wParam, LPARAM lParam) }
//////////////////////////////////////////////////////////
-// When Miranda starting shutdown sequence
-static int gg_preshutdown(WPARAM wParam, LPARAM lParam)
-{
- gg_links_destroy();
-
- return 0;
-}
-
-//////////////////////////////////////////////////////////
// Gets protocol instance associated with a contact
static GGPROTO* gg_getprotoinstance(HANDLE hContact)
{
@@ -349,7 +340,6 @@ extern "C" int __declspec(dllexport) Load(void) // Hook system events
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, gg_modulesloaded);
- hHookPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, gg_preshutdown);
// Prepare protocol name
PROTOCOLDESCRIPTOR pd = { sizeof(pd) };
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index d89d6d43e8..2acf921ec1 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -337,7 +337,6 @@ void WindowFreeIcon(HWND hWnd); /* URI parser functions */
void gg_links_instancemenu_init();
void gg_links_init();
-void gg_links_destroy();
#define UIN2IDA(uin,id) _itoa(uin,id,10)
#define UIN2IDT(uin,id) _itot(uin,id,10)
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index fafaf05c48..2e6238a963 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -24,12 +24,10 @@ //////////////////////////////////////////////////////////
// File Association Manager support
-#define GGS_PARSELINK "%s/ParseLink"
-#define GGS_MENUCHOOSE "%s/MenuChoose"
+#define GGS_PARSELINK "GG/ParseLink"
+#define GGS_MENUCHOOSE "GG/MenuChoose"
static HANDLE hInstanceMenu;
-static HANDLE hServiceMenuChoose;
-static HANDLE hServiceParseLink;
static INT_PTR gg_menuchoose(WPARAM wParam, LPARAM lParam)
{
@@ -111,17 +109,10 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam) void gg_links_instancemenu_init()
{
- char service[MAXMODULELABELLENGTH];
- TMenuParam mnu = {0};
- TMO_MenuItem tmi = {0};
-
- mir_snprintf(service, sizeof(service), GGS_MENUCHOOSE, GGDEF_PROTO);
- hServiceMenuChoose = CreateServiceFunction(service, gg_menuchoose);
- mnu.cbSize = sizeof(mnu);
- mnu.name = "GGAccountChooser";
- mnu.ExecService = service;
- hInstanceMenu = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&mnu);
+ CreateServiceFunction(GGS_MENUCHOOSE, gg_menuchoose);
+ hInstanceMenu = MO_CreateMenuObject("GGAccountChooser", LPGEN("Gadu-Gadu account chooser"), 0, GGS_MENUCHOOSE);
+ TMO_MenuItem tmi = {0};
tmi.cbSize = sizeof(tmi);
tmi.pszName = "Cancel";
tmi.position = 9999999;
@@ -131,23 +122,12 @@ void gg_links_instancemenu_init() void gg_links_init()
{
- if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE))
- {
- char service[MAXMODULELABELLENGTH];
-
- mir_snprintf(service, sizeof(service), GGS_PARSELINK, GGDEF_PROTO);
- hServiceParseLink = CreateServiceFunction(service, gg_parselink);
- AssocMgr_AddNewUrlType("gg:", Translate("Gadu-Gadu Link Protocol"), hInstance, IDI_GG, service, 0);
+ if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
+ CreateServiceFunction(GGS_PARSELINK, gg_parselink);
+ AssocMgr_AddNewUrlType("gg:", Translate("Gadu-Gadu Link Protocol"), hInstance, IDI_GG, GGS_PARSELINK, 0);
}
}
-void gg_links_destroy()
-{
- DestroyServiceFunction(hServiceMenuChoose);
- if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE))
- DestroyServiceFunction(hServiceParseLink);
-}
-
void GGPROTO::links_instance_init()
{
if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
|