diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-23 08:36:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-23 08:36:06 +0000 |
commit | 704a24032eb7067ea526b37d03d8fe935331beea (patch) | |
tree | 62f4263f624a66ff4957aad148f324f7a40d6e6f /protocols/Gadu-Gadu | |
parent | d828acae837c71992f6a5f9dd688ba7afd944e56 (diff) |
fixed problems with services
git-svn-id: http://svn.miranda-ng.org/main/trunk@1109 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r-- | protocols/Gadu-Gadu/gg.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/gg_proto.h | 1 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/groupchat.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/image.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/import.cpp | 10 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/sessions.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/userutils.cpp | 7 |
7 files changed, 19 insertions, 11 deletions
diff --git a/protocols/Gadu-Gadu/gg.cpp b/protocols/Gadu-Gadu/gg.cpp index c92b1d23cc..e34c43e858 100644 --- a/protocols/Gadu-Gadu/gg.cpp +++ b/protocols/Gadu-Gadu/gg.cpp @@ -288,7 +288,7 @@ void GGPROTO::block_init() mi.flags = CMIF_ICONFROMICOLIB;
mir_snprintf(service, sizeof(service), GGS_BLOCKUSER, m_szModuleName);
- createProtoService(service, &GGPROTO::blockuser);
+ createObjService(service, &GGPROTO::blockuser);
mi.position = -500050000;
mi.icolibItem = GetIconHandle(IDI_BLOCK);
mi.pszName = LPGEN("&Block");
diff --git a/protocols/Gadu-Gadu/gg_proto.h b/protocols/Gadu-Gadu/gg_proto.h index bc0d560d3b..4d1e1d6fd8 100644 --- a/protocols/Gadu-Gadu/gg_proto.h +++ b/protocols/Gadu-Gadu/gg_proto.h @@ -234,6 +234,7 @@ struct GGPROTO : public PROTO_INTERFACE, public MZeroedObject void sessions_menus_init(HGENMENU hRoot);
/* Event helpers */
+ void createObjService(const char* szService, GGServiceFunc serviceProc);
void createProtoService(const char* szService, GGServiceFunc serviceProc);
HANDLE hookProtoEvent(const char*, GGEventFunc);
void forkThread(GGThreadFunc, void* );
diff --git a/protocols/Gadu-Gadu/groupchat.cpp b/protocols/Gadu-Gadu/groupchat.cpp index 6127764890..df45da9ea4 100644 --- a/protocols/Gadu-Gadu/groupchat.cpp +++ b/protocols/Gadu-Gadu/groupchat.cpp @@ -72,7 +72,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot) // Conferencing
mir_snprintf(service, sizeof(service), GGS_OPEN_CONF, m_szModuleName);
- createProtoService(service, &GGPROTO::gc_openconf);
+ createObjService(service, &GGPROTO::gc_openconf);
mi.position = 2000050001;
mi.icolibItem = GetIconHandle(IDI_CONFERENCE);
mi.pszName = LPGEN("Open &conference...");
@@ -81,7 +81,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot) // Clear ignored conferences
mir_snprintf(service, sizeof(service), GGS_CLEAR_IGNORED, m_szModuleName);
- createProtoService(service, &GGPROTO::gc_clearignored);
+ createObjService(service, &GGPROTO::gc_clearignored);
mi.position = 2000050002;
mi.icolibItem = GetIconHandle(IDI_CLEAR_CONFERENCE);
mi.pszName = LPGEN("&Clear ignored conferences");
diff --git a/protocols/Gadu-Gadu/image.cpp b/protocols/Gadu-Gadu/image.cpp index 342c2549de..0ad225ad06 100644 --- a/protocols/Gadu-Gadu/image.cpp +++ b/protocols/Gadu-Gadu/image.cpp @@ -76,7 +76,7 @@ int GGPROTO::img_init() // Send image contact menu item
mir_snprintf(service, sizeof(service), GGS_SENDIMAGE, m_szModuleName);
- createProtoService(service, &GGPROTO::img_sendimg);
+ createObjService(service, &GGPROTO::img_sendimg);
mi.position = -2000010000;
mi.icolibItem = GetIconHandle(IDI_IMAGE);
mi.pszName = LPGEN("&Image");
@@ -86,7 +86,7 @@ int GGPROTO::img_init() // Receive image
mir_snprintf(service, sizeof(service), GGS_RECVIMAGE, m_szModuleName);
- createProtoService(service, &GGPROTO::img_recvimage);
+ createObjService(service, &GGPROTO::img_recvimage);
return FALSE;
}
diff --git a/protocols/Gadu-Gadu/import.cpp b/protocols/Gadu-Gadu/import.cpp index 6d03d4782c..8c81e1140f 100644 --- a/protocols/Gadu-Gadu/import.cpp +++ b/protocols/Gadu-Gadu/import.cpp @@ -606,7 +606,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Import from server item
mir_snprintf(service, sizeof(service), GGS_IMPORT_SERVER, m_szModuleName);
- createProtoService(service, &GGPROTO::import_server);
+ createObjService(service, &GGPROTO::import_server);
mi.position = 2000500001;
mi.icolibItem = GetIconHandle(IDI_IMPORT_SERVER);
mi.pszName = LPGEN("Import List From &Server");
@@ -615,7 +615,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Import from textfile
mir_snprintf(service, sizeof(service), GGS_IMPORT_TEXT, m_szModuleName);
- createProtoService(service, &GGPROTO::import_text);
+ createObjService(service, &GGPROTO::import_text);
mi.position = 2000500002;
mi.icolibItem = GetIconHandle(IDI_IMPORT_TEXT);
mi.pszName = LPGEN("Import List From &Text File...");
@@ -624,7 +624,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Remove from server
mir_snprintf(service, sizeof(service), GGS_REMOVE_SERVER, m_szModuleName);
- createProtoService(service, &GGPROTO::remove_server);
+ createObjService(service, &GGPROTO::remove_server);
mi.position = 2000500003;
mi.icolibItem = GetIconHandle(IDI_REMOVE_SERVER);
mi.pszName = LPGEN("&Remove List From Server");
@@ -633,7 +633,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Export to server
mir_snprintf(service, sizeof(service), GGS_EXPORT_SERVER, m_szModuleName);
- createProtoService(service, &GGPROTO::export_server);
+ createObjService(service, &GGPROTO::export_server);
mi.position = 2005000001;
mi.icolibItem = GetIconHandle(IDI_EXPORT_SERVER);
mi.pszName = LPGEN("Export List To &Server");
@@ -642,7 +642,7 @@ void GGPROTO::import_init(HGENMENU hRoot) // Export to textfile
mir_snprintf(service, sizeof(service), GGS_EXPORT_TEXT, m_szModuleName);
- createProtoService(service, &GGPROTO::export_text);
+ createObjService(service, &GGPROTO::export_text);
mi.position = 2005000002;
mi.icolibItem = GetIconHandle(IDI_EXPORT_TEXT);
mi.pszName = LPGEN("Export List To &Text File...");
diff --git a/protocols/Gadu-Gadu/sessions.cpp b/protocols/Gadu-Gadu/sessions.cpp index 4f83780f71..6f047cd783 100644 --- a/protocols/Gadu-Gadu/sessions.cpp +++ b/protocols/Gadu-Gadu/sessions.cpp @@ -433,7 +433,7 @@ void GGPROTO::sessions_menus_init(HGENMENU hRoot) mi.hParentMenu = hRoot;
mir_snprintf(service, sizeof(service), GGS_CONCUR_SESS, m_szModuleName);
- createProtoService(service, &GGPROTO::sessions_view);
+ createObjService(service, &GGPROTO::sessions_view);
if (hMenuRoot)
mi.position = 2050000001;
else
diff --git a/protocols/Gadu-Gadu/userutils.cpp b/protocols/Gadu-Gadu/userutils.cpp index 583994f9fa..f9d241dee7 100644 --- a/protocols/Gadu-Gadu/userutils.cpp +++ b/protocols/Gadu-Gadu/userutils.cpp @@ -287,8 +287,15 @@ HANDLE GGPROTO::hookProtoEvent(const char* szEvent, GGEventFunc handler) //////////////////////////////////////////////////////////
// Adds a new protocol specific service function
+void GGPROTO::createObjService(const char* szService, GGServiceFunc serviceProc)
+{
+ CreateServiceFunctionObj(szService, (MIRANDASERVICEOBJ)*( void** )&serviceProc, this);
+}
+
void GGPROTO::createProtoService(const char* szService, GGServiceFunc serviceProc)
{
+ char str[MAXMODULELABELLENGTH];
+ mir_snprintf(str, sizeof(str), "%s%s", m_szModuleName, szService);
CreateServiceFunctionObj(szService, (MIRANDASERVICEOBJ)*( void** )&serviceProc, this);
}
|