summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/chat.cpp4
-rw-r--r--protocols/AimOscar/src/proto.cpp28
-rw-r--r--protocols/AimOscar/src/theme.cpp14
-rw-r--r--protocols/FacebookRM/src/proto.cpp32
-rw-r--r--protocols/FacebookRM/src/theme.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp20
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp2
-rw-r--r--protocols/IRCG/src/ircproto.cpp57
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp60
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp2
-rw-r--r--protocols/JabberG/src/jabber.h5
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp28
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp6
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp76
-rw-r--r--protocols/MRA/src/Mra.h1
-rw-r--r--protocols/MRA/src/MraChat.cpp2
-rw-r--r--protocols/MRA/src/MraConstans.h3
-rw-r--r--protocols/MRA/src/MraIcons.cpp4
-rw-r--r--protocols/MRA/src/MraProto.cpp40
-rw-r--r--protocols/MSN/src/msn_global.h2
-rw-r--r--protocols/MSN/src/msn_menu.cpp10
-rw-r--r--protocols/MSN/src/msn_proto.cpp40
-rw-r--r--protocols/Omegle/src/proto.cpp10
-rw-r--r--protocols/Skype/src/skype_chat.cpp4
-rw-r--r--protocols/Skype/src/skype_events.cpp2
-rw-r--r--protocols/Skype/src/skype_hooks.cpp8
-rw-r--r--protocols/Skype/src/skype_menus.cpp4
-rw-r--r--protocols/Skype/src/skype_services.cpp18
-rw-r--r--protocols/Tlen/src/jabber.h1
-rw-r--r--protocols/Tlen/src/jabber_svc.cpp4
-rw-r--r--protocols/Twitter/src/chat.cpp2
-rw-r--r--protocols/Twitter/src/proto.cpp22
-rw-r--r--protocols/WhatsApp/src/proto.cpp10
-rw-r--r--protocols/WhatsApp/src/theme.cpp2
-rw-r--r--protocols/Yahoo/src/chat.cpp4
-rw-r--r--protocols/Yahoo/src/proto.cpp6
-rw-r--r--protocols/Yahoo/src/services.cpp124
-rw-r--r--protocols/Yahoo/src/yahoo.h1
42 files changed, 342 insertions, 348 deletions
diff --git a/protocols/AimOscar/src/chat.cpp b/protocols/AimOscar/src/chat.cpp
index 033643f915..1c9f329486 100644
--- a/protocols/AimOscar/src/chat.cpp
+++ b/protocols/AimOscar/src/chat.cpp
@@ -31,8 +31,8 @@ void CAimProto::chat_register(void)
gcr.pszModule = m_szModuleName;
CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
- HookEvent(ME_GC_EVENT, &CAimProto::OnGCEvent);
- HookEvent(ME_GC_BUILDMENU, &CAimProto::OnGCMenuHook );
+ HookProtoEvent(ME_GC_EVENT, &CAimProto::OnGCEvent);
+ HookProtoEvent(ME_GC_BUILDMENU, &CAimProto::OnGCMenuHook );
}
void CAimProto::chat_start(const char* id, unsigned short exchange)
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index e3821fed42..e8148a83c2 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -31,21 +31,21 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) :
InitializeCriticalSection(&SendingMutex);
InitializeCriticalSection(&connMutex);
- CreateService(PS_CREATEACCMGRUI, &CAimProto::SvcCreateAccMgrUI);
+ CreateProtoService(PS_CREATEACCMGRUI, &CAimProto::SvcCreateAccMgrUI);
- CreateService(PS_GETMYAWAYMSG, &CAimProto::GetMyAwayMsg);
+ CreateProtoService(PS_GETMYAWAYMSG, &CAimProto::GetMyAwayMsg);
- CreateService(PS_GETAVATARINFOT, &CAimProto::GetAvatarInfo);
- CreateService(PS_GETMYAVATART, &CAimProto::GetAvatar);
- CreateService(PS_SETMYAVATART, &CAimProto::SetAvatar);
- CreateService(PS_GETAVATARCAPS, &CAimProto::GetAvatarCaps);
+ CreateProtoService(PS_GETAVATARINFOT, &CAimProto::GetAvatarInfo);
+ CreateProtoService(PS_GETMYAVATART, &CAimProto::GetAvatar);
+ CreateProtoService(PS_SETMYAVATART, &CAimProto::SetAvatar);
+ CreateProtoService(PS_GETAVATARCAPS, &CAimProto::GetAvatarCaps);
- CreateService(PS_JOINCHAT, &CAimProto::OnJoinChat);
- CreateService(PS_LEAVECHAT, &CAimProto::OnLeaveChat);
+ CreateProtoService(PS_JOINCHAT, &CAimProto::OnJoinChat);
+ CreateProtoService(PS_LEAVECHAT, &CAimProto::OnLeaveChat);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CAimProto::OnPreBuildContactMenu);
- HookEvent(ME_CLIST_GROUPCHANGE, &CAimProto::OnGroupChange);
- HookEvent(ME_OPT_INITIALISE, &CAimProto::OnOptionsInit);
+ HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CAimProto::OnPreBuildContactMenu);
+ HookProtoEvent(ME_CLIST_GROUPCHANGE, &CAimProto::OnGroupChange);
+ HookProtoEvent(ME_OPT_INITIALISE, &CAimProto::OnOptionsInit);
init_custom_folders();
offline_contacts();
@@ -116,9 +116,9 @@ CAimProto::~CAimProto()
int CAimProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- HookEvent(ME_USERINFO_INITIALISE, &CAimProto::OnUserInfoInit);
- HookEvent(ME_IDLE_CHANGED, &CAimProto::OnIdleChanged);
- HookEvent(ME_MSG_WINDOWEVENT, &CAimProto::OnWindowEvent);
+ HookProtoEvent(ME_USERINFO_INITIALISE, &CAimProto::OnUserInfoInit);
+ HookProtoEvent(ME_IDLE_CHANGED, &CAimProto::OnIdleChanged);
+ HookProtoEvent(ME_MSG_WINDOWEVENT, &CAimProto::OnWindowEvent);
chat_register();
InitContactMenus();
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index 495ac46299..14a97d7f81 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -270,21 +270,21 @@ void CAimProto::InitMainMenus(void)
mi.flags = CMIF_CHILDPOPUP;
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/ManageAccount");
- CreateService("/ManageAccount", &CAimProto::ManageAccount);
+ CreateProtoService("/ManageAccount", &CAimProto::ManageAccount);
mi.position = 201001;
mi.icolibItem = GetIconHandle("aim");
mi.pszName = LPGEN("Manage Account");
hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/InstantIdle");
- CreateService("/InstantIdle",&CAimProto::InstantIdle);
+ CreateProtoService("/InstantIdle",&CAimProto::InstantIdle);
mi.position = 201002;
mi.icolibItem = GetIconHandle("idle");
mi.pszName = LPGEN("Instant Idle");
hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
- CreateService("/JoinChatRoom", &CAimProto::JoinChatUI);
+ CreateProtoService("/JoinChatRoom", &CAimProto::JoinChatUI);
mi.position = 201003;
mi.icolibItem = GetIconHandle("aol");
mi.pszName = LPGEN( "Join Chat Room" );
@@ -301,7 +301,7 @@ void CAimProto::InitContactMenus(void)
mi.pszContactOwner = m_szModuleName;
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetHTMLAwayMsg");
- CreateService("/GetHTMLAwayMsg",&CAimProto::GetHTMLAwayMsg);
+ CreateProtoService("/GetHTMLAwayMsg",&CAimProto::GetHTMLAwayMsg);
mi.position = -2000006000;
mi.icolibItem = GetIconHandle("away");
mi.pszName = LPGEN("Read &HTML Away Message");
@@ -309,7 +309,7 @@ void CAimProto::InitContactMenus(void)
hHTMLAwayContextMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetProfile");
- CreateService("/GetProfile", &CAimProto::GetProfile);
+ CreateProtoService("/GetProfile", &CAimProto::GetProfile);
mi.position = -2000005090;
mi.icolibItem = GetIconHandle("profile");
mi.pszName = LPGEN("Read Profile");
@@ -317,7 +317,7 @@ void CAimProto::InitContactMenus(void)
hReadProfileMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
- CreateService("/AddToServerList", &CAimProto::AddToServerList);
+ CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
mi.position = -2000005080;
mi.icolibItem = GetIconHandle("add");
mi.pszName = LPGEN("Add To Server List");
@@ -325,7 +325,7 @@ void CAimProto::InitContactMenus(void)
hAddToServerListContextMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/BlockCommand");
- CreateService("/BlockCommand", &CAimProto::BlockBuddy);
+ CreateProtoService("/BlockCommand", &CAimProto::BlockBuddy);
mi.position = -2000005060;
mi.icolibItem = GetIconHandle("block");
mi.pszName = LPGEN("&Block");
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 1773b51ff2..a00e4e45e9 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -35,22 +35,22 @@ FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username) :
facy.send_message_lock_ = CreateMutex(NULL, FALSE, NULL);
facy.fcb_conn_lock_ = CreateMutex(NULL, FALSE, NULL);
- CreateService(PS_CREATEACCMGRUI, &FacebookProto::SvcCreateAccMgrUI);
- CreateService(PS_GETMYAWAYMSG, &FacebookProto::GetMyAwayMsg);
- CreateService(PS_GETMYAVATART, &FacebookProto::GetMyAvatar);
- CreateService(PS_GETAVATARINFOT, &FacebookProto::GetAvatarInfo);
- CreateService(PS_GETAVATARCAPS, &FacebookProto::GetAvatarCaps);
-
- CreateService(PS_JOINCHAT, &FacebookProto::OnJoinChat);
- CreateService(PS_LEAVECHAT, &FacebookProto::OnLeaveChat);
-
- CreateService("/Mind", &FacebookProto::OnMind);
-
- HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &FacebookProto::OnBuildStatusMenu);
- HookEvent(ME_OPT_INITIALISE, &FacebookProto::OnOptionsInit);
- HookEvent(ME_GC_EVENT, &FacebookProto::OnChatOutgoing);
- HookEvent(ME_IDLE_CHANGED, &FacebookProto::OnIdleChanged);
- HookEvent(ME_TTB_MODULELOADED, &FacebookProto::OnToolbarInit);
+ CreateProtoService(PS_CREATEACCMGRUI, &FacebookProto::SvcCreateAccMgrUI);
+ CreateProtoService(PS_GETMYAWAYMSG, &FacebookProto::GetMyAwayMsg);
+ CreateProtoService(PS_GETMYAVATART, &FacebookProto::GetMyAvatar);
+ CreateProtoService(PS_GETAVATARINFOT, &FacebookProto::GetAvatarInfo);
+ CreateProtoService(PS_GETAVATARCAPS, &FacebookProto::GetAvatarCaps);
+
+ CreateProtoService(PS_JOINCHAT, &FacebookProto::OnJoinChat);
+ CreateProtoService(PS_LEAVECHAT, &FacebookProto::OnLeaveChat);
+
+ CreateProtoService("/Mind", &FacebookProto::OnMind);
+
+ HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &FacebookProto::OnBuildStatusMenu);
+ HookProtoEvent(ME_OPT_INITIALISE, &FacebookProto::OnOptionsInit);
+ HookProtoEvent(ME_GC_EVENT, &FacebookProto::OnChatOutgoing);
+ HookProtoEvent(ME_IDLE_CHANGED, &FacebookProto::OnIdleChanged);
+ HookProtoEvent(ME_TTB_MODULELOADED, &FacebookProto::OnToolbarInit);
char module[512];
mir_snprintf(module, sizeof(module), "%s/Mind", m_szModuleName);
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index 054a05c134..ffed611d22 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -193,14 +193,14 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.flags = CMIF_CHILDPOPUP | (this->isOnline() ? 0 : CMIF_GRAYED);
mi.position = 201001;
- //CreateService(m_szModuleName,"/Mind",&FacebookProto::OnMind,this);
+ //CreateProtoService(m_szModuleName,"/Mind",&FacebookProto::OnMind,this);
strcpy(tDest,"/Mind");
mi.hParentMenu = hRoot;
mi.pszName = LPGEN("Mind...");
mi.icolibItem = GetIconHandle("mind");
m_hStatusMind = Menu_AddProtoMenuItem(&mi);
- CreateService("/VisitProfile",&FacebookProto::VisitProfile);
+ CreateProtoService("/VisitProfile",&FacebookProto::VisitProfile);
strcpy(tDest,"/VisitProfile");
mi.flags = CMIF_CHILDPOPUP;
mi.pszName = LPGEN("Visit profile");
@@ -215,7 +215,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.icolibItem = NULL;
m_hMenuServicesRoot = Menu_AddProtoMenuItem(&mi);
- CreateService("/RefreshBuddyList",&FacebookProto::RefreshBuddyList);
+ CreateProtoService("/RefreshBuddyList",&FacebookProto::RefreshBuddyList);
strcpy(tDest,"/RefreshBuddyList");
mi.flags = CMIF_ROOTHANDLE;
mi.pszName = LPGEN("Refresh Buddy List");
@@ -224,7 +224,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.hParentMenu = m_hMenuServicesRoot;
Menu_AddProtoMenuItem(&mi);
- CreateService("/CheckFriendRequests",&FacebookProto::CheckFriendRequests);
+ CreateProtoService("/CheckFriendRequests",&FacebookProto::CheckFriendRequests);
strcpy(tDest,"/CheckFriendRequests");
mi.flags = CMIF_ROOTHANDLE;
mi.pszName = LPGEN("Check Friends Requests");
@@ -232,7 +232,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.hParentMenu = m_hMenuServicesRoot;
Menu_AddProtoMenuItem(&mi);
- CreateService("/CheckNewsfeeds",&FacebookProto::CheckNewsfeeds);
+ CreateProtoService("/CheckNewsfeeds",&FacebookProto::CheckNewsfeeds);
strcpy(tDest,"/CheckNewsfeeds");
mi.flags = CMIF_ROOTHANDLE;
mi.pszName = LPGEN("Check Newsfeeds");
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 836384139c..e10057af73 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -260,7 +260,7 @@ void GGPROTO::block_init()
{
char service[64];
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_BLOCKUSER);
- CreateService(GGS_BLOCKUSER, &GGPROTO::blockuser);
+ CreateProtoService(GGS_BLOCKUSER, &GGPROTO::blockuser);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 137c4bb1ef..f87c8451c5 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -51,16 +51,16 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) :
netlib = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
// Register services
- CreateService(PS_GETAVATARCAPS, &GGPROTO::getavatarcaps);
- CreateService(PS_GETAVATARINFOT, &GGPROTO::getavatarinfo);
- CreateService(PS_GETMYAVATART, &GGPROTO::getmyavatar);
- CreateService(PS_SETMYAVATART, &GGPROTO::setmyavatar);
+ CreateProtoService(PS_GETAVATARCAPS, &GGPROTO::getavatarcaps);
+ CreateProtoService(PS_GETAVATARINFOT, &GGPROTO::getavatarinfo);
+ CreateProtoService(PS_GETMYAVATART, &GGPROTO::getmyavatar);
+ CreateProtoService(PS_SETMYAVATART, &GGPROTO::setmyavatar);
- CreateService(PS_GETMYAWAYMSG, &GGPROTO::getmyawaymsg);
- CreateService(PS_SETAWAYMSGT, (MyServiceFunc)&GGPROTO::SetAwayMsg);
- CreateService(PS_CREATEACCMGRUI, &GGPROTO::get_acc_mgr_gui);
+ CreateProtoService(PS_GETMYAWAYMSG, &GGPROTO::getmyawaymsg);
+ CreateProtoService(PS_SETAWAYMSGT, (MyServiceFunc)&GGPROTO::SetAwayMsg);
+ CreateProtoService(PS_CREATEACCMGRUI, &GGPROTO::get_acc_mgr_gui);
- CreateService(PS_LEAVECHAT, &GGPROTO::leavechat);
+ CreateProtoService(PS_LEAVECHAT, &GGPROTO::leavechat);
// Offline contacts and clear logon time
setalloffline();
@@ -792,8 +792,8 @@ int GGPROTO::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
switch( eventType ) {
case EV_PROTO_ONLOAD:
{
- HookEvent(ME_OPT_INITIALISE, &GGPROTO::options_init);
- HookEvent(ME_USERINFO_INITIALISE, &GGPROTO::details_init);
+ HookProtoEvent(ME_OPT_INITIALISE, &GGPROTO::options_init);
+ HookProtoEvent(ME_USERINFO_INITIALISE, &GGPROTO::details_init);
// Init misc stuff
gg_icolib_init();
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 418be65df1..4c9354ec61 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -44,7 +44,7 @@ int GGPROTO::gc_init()
gcr.ptszModuleDispName = m_tszUserName;
gcr.pszModule = m_szModuleName;
CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
- HookEvent(ME_GC_EVENT, &GGPROTO::gc_event);
+ HookProtoEvent(ME_GC_EVENT, &GGPROTO::gc_event);
gc_enabled = TRUE;
// create & hook event
mir_snprintf(service, 64, GG_GC_GETCHAT, m_szModuleName);
@@ -70,7 +70,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot)
// Conferencing
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_OPEN_CONF);
- CreateService(GGS_OPEN_CONF, &GGPROTO::gc_openconf);
+ CreateProtoService(GGS_OPEN_CONF, &GGPROTO::gc_openconf);
mi.position = 2000050001;
mi.icolibItem = iconList[14].hIcolib;
mi.ptszName = LPGENT("Open &conference...");
@@ -79,7 +79,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot)
// Clear ignored conferences
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_CLEAR_IGNORED);
- CreateService(GGS_CLEAR_IGNORED, &GGPROTO::gc_clearignored);
+ CreateProtoService(GGS_CLEAR_IGNORED, &GGPROTO::gc_clearignored);
mi.position = 2000050002;
mi.icolibItem = iconList[15].hIcolib;
mi.ptszName = LPGENT("&Clear ignored conferences");
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 8df70b2cfc..4a86881d19 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -70,7 +70,7 @@ int GGPROTO::img_init()
{
char service[64];
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_SENDIMAGE);
- CreateService(GGS_SENDIMAGE, &GGPROTO::img_sendimg);
+ CreateProtoService(GGS_SENDIMAGE, &GGPROTO::img_sendimg);
// Send image contact menu item
CLISTMENUITEM mi = { sizeof(mi) };
@@ -83,7 +83,7 @@ int GGPROTO::img_init()
hImageMenuItem = Menu_AddContactMenuItem(&mi);
// Receive image
- CreateService(GGS_RECVIMAGE, &GGPROTO::img_recvimage);
+ CreateProtoService(GGS_RECVIMAGE, &GGPROTO::img_recvimage);
return FALSE;
}
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index d19d5abaea..11cf777cd9 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -613,7 +613,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
// Import from server item
char service[64];
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_IMPORT_SERVER);
- CreateService(GGS_IMPORT_SERVER, &GGPROTO::import_server);
+ CreateProtoService(GGS_IMPORT_SERVER, &GGPROTO::import_server);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
@@ -626,7 +626,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
// Import from textfile
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_IMPORT_TEXT);
- CreateService(GGS_IMPORT_TEXT, &GGPROTO::import_text);
+ CreateProtoService(GGS_IMPORT_TEXT, &GGPROTO::import_text);
mi.position = 2000500002;
mi.icolibItem = iconList[2].hIcolib;
@@ -636,7 +636,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
// Remove from server
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_REMOVE_SERVER);
- CreateService(GGS_REMOVE_SERVER, &GGPROTO::remove_server);
+ CreateProtoService(GGS_REMOVE_SERVER, &GGPROTO::remove_server);
mi.position = 2000500003;
mi.icolibItem = iconList[3].hIcolib;
@@ -646,7 +646,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
// Export to server
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_EXPORT_SERVER);
- CreateService(GGS_EXPORT_SERVER, &GGPROTO::export_server);
+ CreateProtoService(GGS_EXPORT_SERVER, &GGPROTO::export_server);
mi.position = 2005000001;
mi.icolibItem = iconList[4].hIcolib;
@@ -656,7 +656,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
// Export to textfile
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_EXPORT_TEXT);
- CreateService(GGS_EXPORT_TEXT, &GGPROTO::export_text);
+ CreateProtoService(GGS_EXPORT_TEXT, &GGPROTO::export_text);
mi.position = 2005000002;
mi.icolibItem = iconList[5].hIcolib;
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index 7268d9fafc..a49500a567 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -427,7 +427,7 @@ void GGPROTO::sessions_menus_init(HGENMENU hRoot)
{
char service[64];
mir_snprintf(service, sizeof(service), "%s%s", m_szModuleName, GGS_CONCUR_SESS);
- CreateService(service, &GGPROTO::sessions_view);
+ CreateProtoService(service, &GGPROTO::sessions_view);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index c45baa3d88..9a5cfe818d 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -43,28 +43,28 @@ CIrcProto::CIrcProto(const char* szModuleName, const TCHAR* tszUserName) :
InitializeCriticalSection(&m_gchook);
m_evWndCreate = ::CreateEvent( NULL, FALSE, FALSE, NULL );
- CreateService( PS_GETMYAWAYMSG, &CIrcProto::GetMyAwayMsg );
-
- CreateService( PS_CREATEACCMGRUI, &CIrcProto::SvcCreateAccMgrUI );
- CreateService( PS_JOINCHAT, &CIrcProto::OnJoinChat );
- CreateService( PS_LEAVECHAT, &CIrcProto::OnLeaveChat );
-
- CreateService( IRC_JOINCHANNEL, &CIrcProto::OnJoinMenuCommand );
- CreateService( IRC_QUICKCONNECT, &CIrcProto::OnQuickConnectMenuCommand);
- CreateService( IRC_CHANGENICK, &CIrcProto::OnChangeNickMenuCommand );
- CreateService( IRC_SHOWLIST, &CIrcProto::OnShowListMenuCommand );
- CreateService( IRC_SHOWSERVER, &CIrcProto::OnShowServerMenuCommand );
- CreateService( IRC_UM_CHANSETTINGS, &CIrcProto::OnMenuChanSettings );
- CreateService( IRC_UM_WHOIS, &CIrcProto::OnMenuWhois );
- CreateService( IRC_UM_DISCONNECT, &CIrcProto::OnMenuDisconnect );
- CreateService( IRC_UM_IGNORE, &CIrcProto::OnMenuIgnore );
-
- CreateService( "/DblClickEvent", &CIrcProto::OnDoubleclicked );
- CreateService( "/InsertRawIn", &CIrcProto::Scripting_InsertRawIn );
- CreateService( "/InsertRawOut", &CIrcProto::Scripting_InsertRawOut );
- CreateService( "/InsertGuiIn", &CIrcProto::Scripting_InsertGuiIn );
- CreateService( "/InsertGuiOut", &CIrcProto::Scripting_InsertGuiOut);
- CreateService( "/GetIrcData", &CIrcProto::Scripting_GetIrcData);
+ CreateProtoService( PS_GETMYAWAYMSG, &CIrcProto::GetMyAwayMsg );
+
+ CreateProtoService( PS_CREATEACCMGRUI, &CIrcProto::SvcCreateAccMgrUI );
+ CreateProtoService( PS_JOINCHAT, &CIrcProto::OnJoinChat );
+ CreateProtoService( PS_LEAVECHAT, &CIrcProto::OnLeaveChat );
+
+ CreateProtoService( IRC_JOINCHANNEL, &CIrcProto::OnJoinMenuCommand );
+ CreateProtoService( IRC_QUICKCONNECT, &CIrcProto::OnQuickConnectMenuCommand);
+ CreateProtoService( IRC_CHANGENICK, &CIrcProto::OnChangeNickMenuCommand );
+ CreateProtoService( IRC_SHOWLIST, &CIrcProto::OnShowListMenuCommand );
+ CreateProtoService( IRC_SHOWSERVER, &CIrcProto::OnShowServerMenuCommand );
+ CreateProtoService( IRC_UM_CHANSETTINGS, &CIrcProto::OnMenuChanSettings );
+ CreateProtoService( IRC_UM_WHOIS, &CIrcProto::OnMenuWhois );
+ CreateProtoService( IRC_UM_DISCONNECT, &CIrcProto::OnMenuDisconnect );
+ CreateProtoService( IRC_UM_IGNORE, &CIrcProto::OnMenuIgnore );
+
+ CreateProtoService( "/DblClickEvent", &CIrcProto::OnDoubleclicked );
+ CreateProtoService( "/InsertRawIn", &CIrcProto::Scripting_InsertRawIn );
+ CreateProtoService( "/InsertRawOut", &CIrcProto::Scripting_InsertRawOut );
+ CreateProtoService( "/InsertGuiIn", &CIrcProto::Scripting_InsertGuiIn );
+ CreateProtoService( "/InsertGuiOut", &CIrcProto::Scripting_InsertGuiOut);
+ CreateProtoService( "/GetIrcData", &CIrcProto::Scripting_GetIrcData);
codepage = CP_ACP;
InitializeCriticalSection(&m_resolve);
@@ -228,9 +228,10 @@ int CIrcProto::OnModulesLoaded( WPARAM, LPARAM )
gcr.pColors = colors;
gcr.ptszModuleDispName = m_tszUserName;
gcr.pszModule = m_szModuleName;
- CallServiceSync( MS_GC_REGISTER, NULL, (LPARAM)&gcr );
- HookEvent( ME_GC_EVENT, &CIrcProto::GCEventHook );
- HookEvent( ME_GC_BUILDMENU, &CIrcProto::GCMenuHook );
+ CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
+
+ HookProtoEvent(ME_GC_EVENT, &CIrcProto::GCEventHook);
+ HookProtoEvent(ME_GC_BUILDMENU, &CIrcProto::GCMenuHook);
GCSESSION gcw = { sizeof(GCSESSION) };
gcw.dwFlags = GC_TCHAR;
@@ -238,7 +239,7 @@ int CIrcProto::OnModulesLoaded( WPARAM, LPARAM )
gcw.ptszID = SERVERWINDOW;
gcw.pszModule = m_szModuleName;
gcw.ptszName = NEWTSTR_ALLOCA(( TCHAR* )_A2T( m_network ));
- CallServiceSync( MS_GC_NEWSESSION, 0, (LPARAM)&gcw );
+ CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw);
GCDEST gcd = { 0 };
gcd.ptszID = SERVERWINDOW;
@@ -309,8 +310,8 @@ int CIrcProto::OnModulesLoaded( WPARAM, LPARAM )
InitIgnore();
- HookEvent( ME_USERINFO_INITIALISE, &CIrcProto::OnInitUserInfo );
- HookEvent( ME_OPT_INITIALISE, &CIrcProto::OnInitOptionsPages );
+ HookProtoEvent( ME_USERINFO_INITIALISE, &CIrcProto::OnInitUserInfo );
+ HookProtoEvent( ME_OPT_INITIALISE, &CIrcProto::OnInitOptionsPages );
if (m_nick[0]) {
TCHAR szBuf[ 40 ];
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index a48b7ac990..aba1581956 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -89,7 +89,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
// Initialize server lists
servlistMutex = new icq_critical_section();
servlistQueueMutex = new icq_critical_section();
- HookEvent(ME_CLIST_GROUPCHANGE, &CIcqProto::ServListCListGroupChange);
+ HookProtoEvent(ME_CLIST_GROUPCHANGE, &CIcqProto::ServListCListGroupChange);
// Initialize status message struct
ZeroMemory(&m_modeMsgs, sizeof(icq_mode_messages));
@@ -97,7 +97,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
connectionHandleMutex = new icq_critical_section();
localSeqMutex = new icq_critical_section();
- m_modeMsgsEvent = CreateHookableEvent(ME_ICQ_STATUSMSGREQ);
+ m_modeMsgsEvent = CreateProtoEvent(ME_ICQ_STATUSMSGREQ);
// Initialize cookies
cookieMutex = new icq_critical_section();
@@ -122,42 +122,42 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
db_set_resident(m_szModuleName, DBSETTING_STATUS_MOOD);
// Setup services
- CreateService(PS_CREATEACCMGRUI, &CIcqProto::OnCreateAccMgrUI );
- CreateService(MS_ICQ_SENDSMS, &CIcqProto::SendSms);
- CreateService(PS_SET_NICKNAME, &CIcqProto::SetNickName);
+ CreateProtoService(PS_CREATEACCMGRUI, &CIcqProto::OnCreateAccMgrUI );
+ CreateProtoService(MS_ICQ_SENDSMS, &CIcqProto::SendSms);
+ CreateProtoService(PS_SET_NICKNAME, &CIcqProto::SetNickName);
- CreateService(PS_GETMYAWAYMSG, &CIcqProto::GetMyAwayMsg);
+ CreateProtoService(PS_GETMYAWAYMSG, &CIcqProto::GetMyAwayMsg);
- CreateService(PS_GETINFOSETTING, &CIcqProto::GetInfoSetting);
+ CreateProtoService(PS_GETINFOSETTING, &CIcqProto::GetInfoSetting);
- CreateService(PSS_ADDED, &CIcqProto::SendYouWereAdded);
+ CreateProtoService(PSS_ADDED, &CIcqProto::SendYouWereAdded);
// Session password API
- CreateService(PS_ICQ_SETPASSWORD, &CIcqProto::SetPassword);
+ CreateProtoService(PS_ICQ_SETPASSWORD, &CIcqProto::SetPassword);
// ChangeInfo API
- CreateService(PS_CHANGEINFOEX, &CIcqProto::ChangeInfoEx);
+ CreateProtoService(PS_CHANGEINFOEX, &CIcqProto::ChangeInfoEx);
// Avatar API
- CreateService(PS_GETAVATARINFOT, &CIcqProto::GetAvatarInfo);
- CreateService(PS_GETAVATARCAPS, &CIcqProto::GetAvatarCaps);
- CreateService(PS_GETMYAVATART, &CIcqProto::GetMyAvatar);
- CreateService(PS_SETMYAVATART, &CIcqProto::SetMyAvatar);
+ CreateProtoService(PS_GETAVATARINFOT, &CIcqProto::GetAvatarInfo);
+ CreateProtoService(PS_GETAVATARCAPS, &CIcqProto::GetAvatarCaps);
+ CreateProtoService(PS_GETMYAVATART, &CIcqProto::GetMyAvatar);
+ CreateProtoService(PS_SETMYAVATART, &CIcqProto::SetMyAvatar);
// Custom Status API
- CreateService(PS_SETCUSTOMSTATUSEX, &CIcqProto::SetXStatusEx);
- CreateService(PS_GETCUSTOMSTATUSEX, &CIcqProto::GetXStatusEx);
- CreateService(PS_GETCUSTOMSTATUSICON, &CIcqProto::GetXStatusIcon);
- CreateService(PS_GETADVANCEDSTATUSICON, &CIcqProto::RequestAdvStatusIconIdx);
- CreateService(PS_ICQ_REQUESTCUSTOMSTATUS, &CIcqProto::RequestXStatusDetails);
+ CreateProtoService(PS_SETCUSTOMSTATUSEX, &CIcqProto::SetXStatusEx);
+ CreateProtoService(PS_GETCUSTOMSTATUSEX, &CIcqProto::GetXStatusEx);
+ CreateProtoService(PS_GETCUSTOMSTATUSICON, &CIcqProto::GetXStatusIcon);
+ CreateProtoService(PS_GETADVANCEDSTATUSICON, &CIcqProto::RequestAdvStatusIconIdx);
+ CreateProtoService(PS_ICQ_REQUESTCUSTOMSTATUS, &CIcqProto::RequestXStatusDetails);
- CreateService(MS_ICQ_ADDSERVCONTACT, &CIcqProto::AddServerContact);
+ CreateProtoService(MS_ICQ_ADDSERVCONTACT, &CIcqProto::AddServerContact);
- CreateService(MS_REQ_AUTH, &CIcqProto::RequestAuthorization);
- CreateService(MS_GRANT_AUTH, &CIcqProto::GrantAuthorization);
- CreateService(MS_REVOKE_AUTH, &CIcqProto::RevokeAuthorization);
+ CreateProtoService(MS_REQ_AUTH, &CIcqProto::RequestAuthorization);
+ CreateProtoService(MS_GRANT_AUTH, &CIcqProto::GrantAuthorization);
+ CreateProtoService(MS_REVOKE_AUTH, &CIcqProto::RevokeAuthorization);
- CreateService(MS_XSTATUS_SHOWDETAILS, &CIcqProto::ShowXStatusDetails);
+ CreateProtoService(MS_XSTATUS_SHOWDETAILS, &CIcqProto::ShowXStatusDetails);
// Custom caps
- CreateService(PS_ICQ_ADDCAPABILITY, &CIcqProto::IcqAddCapability);
- CreateService(PS_ICQ_CHECKCAPABILITY, &CIcqProto::IcqCheckCapability);
+ CreateProtoService(PS_ICQ_ADDCAPABILITY, &CIcqProto::IcqAddCapability);
+ CreateProtoService(PS_ICQ_CHECKCAPABILITY, &CIcqProto::IcqCheckCapability);
// Reset a bunch of session specific settings
UpdateGlobalSettings();
@@ -169,7 +169,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
// Startup Auto Info-Update thread
icq_InitInfoUpdate();
- HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &CIcqProto::OnPreBuildStatusMenu);
+ HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CIcqProto::OnPreBuildStatusMenu);
// Register netlib users
NETLIBUSER nlu = {0};
@@ -285,9 +285,9 @@ int CIcqProto::OnModulesLoaded( WPARAM wParam, LPARAM lParam )
modules[3] = pszSrvGroupsName;
CallService("DBEditorpp/RegisterModule",(WPARAM)modules,(LPARAM)4);
- HookEvent(ME_OPT_INITIALISE, &CIcqProto::OnOptionsInit);
- HookEvent(ME_USERINFO_INITIALISE, &CIcqProto::OnUserInfoInit);
- HookEvent(ME_IDLE_CHANGED, &CIcqProto::OnIdleChanged);
+ HookProtoEvent(ME_OPT_INITIALISE, &CIcqProto::OnOptionsInit);
+ HookProtoEvent(ME_USERINFO_INITIALISE, &CIcqProto::OnUserInfoInit);
+ HookProtoEvent(ME_IDLE_CHANGED, &CIcqProto::OnIdleChanged);
InitAvatars();
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index fcf52931da..cbd548094f 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -871,7 +871,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
bXStatusMenuBuilt = ServiceExists(srvFce);
if (!bXStatusMenuBuilt)
- CreateServiceParam(srvFce+len, &CIcqProto::menuXStatus, i);
+ CreateProtoServiceParam(srvFce+len, &CIcqProto::menuXStatus, i);
mi.flags = (bXStatus == i ? CMIF_CHECKED : 0);
mi.icolibItem = i ? hXStatusIcons[i-1] : NULL;
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h
index b91a720edd..4c3108726d 100644
--- a/protocols/JabberG/src/jabber.h
+++ b/protocols/JabberG/src/jabber.h
@@ -102,6 +102,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_modernopt.h>
#include <m_popup.h>
#include <m_proto_listeningto.h>
+#include <m_nudge.h>
#include <m_skin_eng.h>
#include "../../plugins/zlib/src/zlib.h"
@@ -259,10 +260,6 @@ enum {
// Services and Events
#define JS_PARSE_XMPP_URI "/ParseXmppURI"
-// XEP-0224 support (Attention/Nudge)
-#define JS_SEND_NUDGE "/SendNudge"
-#define JE_NUDGE "/Nudge"
-
// Called when contact changes custom status and extra icon is set to clist_mw
//wParam = hContact // contact changing status
//lParam = hIcon // HANDLE to clist extra icon set as custom status
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 11ba7259ea..e70e94d14d 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -441,7 +441,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
for (int i = 0; i < nMenuResourceItemsNew; i++) {
mir_snprintf(tDest, SIZEOF(text) - nModuleNameLength, "/UseResource_%d", i);
if (i >= m_nMenuResourceItems) {
- CreateServiceParam(tDest, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES+i);
+ CreateProtoServiceParam(tDest, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES+i);
mi.pszName = "";
mi.position = i;
mi.hParentMenu = g_hMenuResourcesRoot;
@@ -673,7 +673,7 @@ void CJabberProto::MenuInit()
}
// "Bookmarks..."
- CreateService("/Bookmarks", &CJabberProto::OnMenuHandleBookmarks);
+ CreateProtoService("/Bookmarks", &CJabberProto::OnMenuHandleBookmarks);
strcpy(tDest, "/Bookmarks");
mi.flags = CMIF_CHILDPOPUP;
mi.hParentMenu = hJabberRoot;
@@ -683,7 +683,7 @@ void CJabberProto::MenuInit()
m_hMenuBookmarks = Menu_AddProtoMenuItem(&mi);
// "Options..."
- CreateService("/Options", &CJabberProto::OnMenuOptions);
+ CreateProtoService("/Options", &CJabberProto::OnMenuOptions);
strcpy(tDest, "/Options");
mi.pszName = LPGEN("Options...");
mi.position = 200002;
@@ -698,7 +698,7 @@ void CJabberProto::MenuInit()
HGENMENU hMenuServicesRoot = Menu_AddProtoMenuItem(&mi);
// "Service Discovery..."
- CreateService("/ServiceDiscovery", &CJabberProto::OnMenuHandleServiceDiscovery);
+ CreateProtoService("/ServiceDiscovery", &CJabberProto::OnMenuHandleServiceDiscovery);
strcpy(tDest, "/ServiceDiscovery");
mi.flags = CMIF_ROOTHANDLE;
mi.pszName = LPGEN("Service Discovery");
@@ -707,28 +707,28 @@ void CJabberProto::MenuInit()
mi.hParentMenu = hMenuServicesRoot;
m_hMenuServiceDiscovery = Menu_AddProtoMenuItem(&mi);
- CreateService("/SD/MyTransports", &CJabberProto::OnMenuHandleServiceDiscoveryMyTransports);
+ CreateProtoService("/SD/MyTransports", &CJabberProto::OnMenuHandleServiceDiscoveryMyTransports);
strcpy(tDest, "/SD/MyTransports");
mi.pszName = LPGEN("Registered Transports");
mi.position = 2000050003;
mi.icolibItem = GetIconHandle(IDI_TRANSPORTL);
m_hMenuSDMyTransports = Menu_AddProtoMenuItem(&mi);
- CreateService("/SD/Transports", &CJabberProto::OnMenuHandleServiceDiscoveryTransports);
+ CreateProtoService("/SD/Transports", &CJabberProto::OnMenuHandleServiceDiscoveryTransports);
strcpy(tDest, "/SD/Transports");
mi.pszName = LPGEN("Local Server Transports");
mi.position = 2000050004;
mi.icolibItem = GetIconHandle(IDI_TRANSPORT);
m_hMenuSDTransports = Menu_AddProtoMenuItem(&mi);
- CreateService("/SD/Conferences", &CJabberProto::OnMenuHandleServiceDiscoveryConferences);
+ CreateProtoService("/SD/Conferences", &CJabberProto::OnMenuHandleServiceDiscoveryConferences);
strcpy(tDest, "/SD/Conferences");
mi.pszName = LPGEN("Browse Chatrooms");
mi.position = 2000050005;
mi.icolibItem = GetIconHandle(IDI_GROUP);
m_hMenuSDConferences = Menu_AddProtoMenuItem(&mi);
- CreateService("/Groupchat", &CJabberProto::OnMenuHandleJoinGroupchat);
+ CreateProtoService("/Groupchat", &CJabberProto::OnMenuHandleJoinGroupchat);
strcpy(tDest, "/Groupchat");
mi.pszName = LPGEN("Create/Join groupchat");
mi.position = 2000050006;
@@ -736,7 +736,7 @@ void CJabberProto::MenuInit()
m_hMenuGroupchat = Menu_AddProtoMenuItem(&mi);
// "Change Password..."
- CreateService("/ChangePassword", &CJabberProto::OnMenuHandleChangePassword);
+ CreateProtoService("/ChangePassword", &CJabberProto::OnMenuHandleChangePassword);
strcpy(tDest, "/ChangePassword");
mi.pszName = LPGEN("Change Password");
mi.position = 2000050007;
@@ -744,7 +744,7 @@ void CJabberProto::MenuInit()
m_hMenuChangePassword = Menu_AddProtoMenuItem(&mi);
// "Roster editor"
- CreateService("/RosterEditor", &CJabberProto::OnMenuHandleRosterControl);
+ CreateProtoService("/RosterEditor", &CJabberProto::OnMenuHandleRosterControl);
strcpy(tDest, "/RosterEditor");
mi.pszName = LPGEN("Roster editor");
mi.position = 2000050009;
@@ -752,14 +752,14 @@ void CJabberProto::MenuInit()
m_hMenuRosterControl = Menu_AddProtoMenuItem(&mi);
// "XML Console"
- CreateService("/XMLConsole", &CJabberProto::OnMenuHandleConsole);
+ CreateProtoService("/XMLConsole", &CJabberProto::OnMenuHandleConsole);
strcpy(tDest, "/XMLConsole");
mi.pszName = LPGEN("XML Console");
mi.position = 2000050010;
mi.icolibItem = GetIconHandle(IDI_CONSOLE);
Menu_AddProtoMenuItem(&mi);
- CreateService("/Notes", &CJabberProto::OnMenuHandleNotes);
+ CreateProtoService("/Notes", &CJabberProto::OnMenuHandleNotes);
strcpy(tDest, "/Notes");
mi.pszName = LPGEN("Notes");
mi.position = 2000050011;
@@ -793,7 +793,7 @@ void CJabberProto::MenuInit()
mir_snprintf(srvFce, sizeof(srvFce), "%s/menuSetPriority/0", m_szModuleName);
bool needServices = !ServiceExists(srvFce);
if (needServices)
- CreateServiceParam(svcName, &CJabberProto::OnMenuSetPriority, 0);
+ CreateProtoServiceParam(svcName, &CJabberProto::OnMenuSetPriority, 0);
int steps[] = { 10, 5, 1, 0, -1, -5, -10 };
for (int i = 0; i < SIZEOF(steps); i++) {
@@ -808,7 +808,7 @@ void CJabberProto::MenuInit()
mir_snprintf(szName, sizeof(szName), (steps[i] > 0) ? "Increase priority by %d" : "Decrease priority by %d", abs(steps[i]));
if (needServices)
- CreateServiceParam(svcName, &CJabberProto::OnMenuSetPriority, (LPARAM)steps[i]);
+ CreateProtoServiceParam(svcName, &CJabberProto::OnMenuSetPriority, (LPARAM)steps[i]);
mi.position++;
Menu_AddProtoMenuItem(&mi);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 6e749cca79..abe3a5dead 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -2224,7 +2224,7 @@ void CJabberProto::BuildPrivacyMenu()
mi.hParentMenu = MO_GetProtoRootMenu(m_szModuleName);
m_hPrivacyMenuRoot = Menu_AddProtoMenuItem(&mi);
- CreateService("/PrivacyLists", &CJabberProto::OnMenuHandlePrivacyLists);
+ CreateProtoService("/PrivacyLists", &CJabberProto::OnMenuHandlePrivacyLists);
char srvFce[MAX_PATH + 64];
mir_snprintf(srvFce, SIZEOF(srvFce), "%s/PrivacyLists", m_szModuleName);
mi.pszService = srvFce;
@@ -2257,7 +2257,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
mir_snprintf(srvFce, SIZEOF(srvFce), "%s/menuPrivacy%d", m_szModuleName, i);
if (i > m_privacyMenuServiceAllocated) {
- CreateServiceParam(svcName, &CJabberProto::menuSetPrivacyList, i);
+ CreateProtoServiceParam(svcName, &CJabberProto::menuSetPrivacyList, i);
m_privacyMenuServiceAllocated = i;
}
mi.position++;
@@ -2273,7 +2273,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
mir_snprintf(srvFce, SIZEOF(srvFce), "%s/menuPrivacy%d", m_szModuleName, i);
if (i > m_privacyMenuServiceAllocated) {
- CreateServiceParam(svcName, &CJabberProto::menuSetPrivacyList, i);
+ CreateProtoServiceParam(svcName, &CJabberProto::menuSetPrivacyList, i);
m_privacyMenuServiceAllocated = i;
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index da49fcbf66..a17213387b 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -88,50 +88,50 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) :
m_windowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
// Protocol services and events...
- m_hEventNudge = CreateHookableEvent(JE_NUDGE);
- m_hEventXStatusIconChanged = CreateHookableEvent(JE_CUSTOMSTATUS_EXTRAICON_CHANGED);
- m_hEventXStatusChanged = CreateHookableEvent(JE_CUSTOMSTATUS_CHANGED);
+ m_hEventNudge = CreateProtoEvent(PE_NUDGE);
+ m_hEventXStatusIconChanged = CreateProtoEvent(JE_CUSTOMSTATUS_EXTRAICON_CHANGED);
+ m_hEventXStatusChanged = CreateProtoEvent(JE_CUSTOMSTATUS_CHANGED);
- CreateService(PS_CREATEACCMGRUI, &CJabberProto::SvcCreateAccMgrUI);
+ CreateProtoService(PS_CREATEACCMGRUI, &CJabberProto::SvcCreateAccMgrUI);
- CreateService(PS_GETAVATARINFOT, &CJabberProto::JabberGetAvatarInfo);
- CreateService(PS_GETMYAWAYMSG, &CJabberProto::GetMyAwayMsg);
- CreateService(PS_SET_LISTENINGTO, &CJabberProto::OnSetListeningTo);
+ CreateProtoService(PS_GETAVATARINFOT, &CJabberProto::JabberGetAvatarInfo);
+ CreateProtoService(PS_GETMYAWAYMSG, &CJabberProto::GetMyAwayMsg);
+ CreateProtoService(PS_SET_LISTENINGTO, &CJabberProto::OnSetListeningTo);
- CreateService(PS_JOINCHAT, &CJabberProto::OnJoinChat);
- CreateService(PS_LEAVECHAT, &CJabberProto::OnLeaveChat);
+ CreateProtoService(PS_JOINCHAT, &CJabberProto::OnJoinChat);
+ CreateProtoService(PS_LEAVECHAT, &CJabberProto::OnLeaveChat);
- CreateService(PS_GETCUSTOMSTATUSEX, &CJabberProto::OnGetXStatusEx);
- CreateService(PS_SETCUSTOMSTATUSEX, &CJabberProto::OnSetXStatusEx);
- CreateService(PS_GETCUSTOMSTATUSICON, &CJabberProto::OnGetXStatusIcon);
- CreateService(PS_GETADVANCEDSTATUSICON, &CJabberProto::JGetAdvancedStatusIcon);
+ CreateProtoService(PS_GETCUSTOMSTATUSEX, &CJabberProto::OnGetXStatusEx);
+ CreateProtoService(PS_SETCUSTOMSTATUSEX, &CJabberProto::OnSetXStatusEx);
+ CreateProtoService(PS_GETCUSTOMSTATUSICON, &CJabberProto::OnGetXStatusIcon);
+ CreateProtoService(PS_GETADVANCEDSTATUSICON, &CJabberProto::JGetAdvancedStatusIcon);
- CreateService(JS_HTTP_AUTH, &CJabberProto::OnHttpAuthRequest);
- CreateService(JS_INCOMING_NOTE_EVENT, &CJabberProto::OnIncomingNoteEvent);
+ CreateProtoService(JS_HTTP_AUTH, &CJabberProto::OnHttpAuthRequest);
+ CreateProtoService(JS_INCOMING_NOTE_EVENT, &CJabberProto::OnIncomingNoteEvent);
- CreateService(JS_SENDXML, &CJabberProto::ServiceSendXML);
- CreateService(PS_GETMYAVATART, &CJabberProto::JabberGetAvatar);
- CreateService(PS_GETAVATARCAPS, &CJabberProto::JabberGetAvatarCaps);
- CreateService(PS_SETMYAVATART, &CJabberProto::JabberSetAvatar);
- CreateService(PS_SETMYNICKNAME, &CJabberProto::JabberSetNickname);
+ CreateProtoService(JS_SENDXML, &CJabberProto::ServiceSendXML);
+ CreateProtoService(PS_GETMYAVATART, &CJabberProto::JabberGetAvatar);
+ CreateProtoService(PS_GETAVATARCAPS, &CJabberProto::JabberGetAvatarCaps);
+ CreateProtoService(PS_SETMYAVATART, &CJabberProto::JabberSetAvatar);
+ CreateProtoService(PS_SETMYNICKNAME, &CJabberProto::JabberSetNickname);
- CreateService(JS_DB_GETEVENTTEXT_CHATSTATES, &CJabberProto::OnGetEventTextChatStates);
- CreateService(JS_DB_GETEVENTTEXT_PRESENCE, &CJabberProto::OnGetEventTextPresence);
+ CreateProtoService(JS_DB_GETEVENTTEXT_CHATSTATES, &CJabberProto::OnGetEventTextChatStates);
+ CreateProtoService(JS_DB_GETEVENTTEXT_PRESENCE, &CJabberProto::OnGetEventTextPresence);
- CreateService(JS_GETJABBERAPI, &CJabberProto::JabberGetApi);
+ CreateProtoService(JS_GETJABBERAPI, &CJabberProto::JabberGetApi);
// XEP-0224 support (Attention/Nudge)
- CreateService(JS_SEND_NUDGE, &CJabberProto::JabberSendNudge);
+ CreateProtoService(PS_SEND_NUDGE, &CJabberProto::JabberSendNudge);
// service to get from protocol chat buddy info
- CreateService(MS_GC_PROTO_GETTOOLTIPTEXT, &CJabberProto::JabberGCGetToolTipText);
+ CreateProtoService(MS_GC_PROTO_GETTOOLTIPTEXT, &CJabberProto::JabberGCGetToolTipText);
// XMPP URI parser service for "File Association Manager" plugin
- CreateService(JS_PARSE_XMPP_URI, &CJabberProto::JabberServiceParseXmppURI);
+ CreateProtoService(JS_PARSE_XMPP_URI, &CJabberProto::JabberServiceParseXmppURI);
- HookEvent(ME_MODERNOPT_INITIALIZE, &CJabberProto::OnModernOptInit);
- HookEvent(ME_OPT_INITIALISE, &CJabberProto::OnOptionsInit);
- HookEvent(ME_SKIN2_ICONSCHANGED, &CJabberProto::OnReloadIcons);
+ HookProtoEvent(ME_MODERNOPT_INITIALIZE, &CJabberProto::OnModernOptInit);
+ HookProtoEvent(ME_OPT_INITIALISE, &CJabberProto::OnOptionsInit);
+ HookProtoEvent(ME_SKIN2_ICONSCHANGED, &CJabberProto::OnReloadIcons);
m_iqManager.FillPermanentHandlers();
m_iqManager.Start();
@@ -159,7 +159,7 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) :
db_set_resident(m_szModuleName, "Status");
db_set_resident(m_szModuleName, DBSETTING_DISPLAY_UID);
-
+
db_set_resident(m_szModuleName, "SubscriptionText");
db_set_resident(m_szModuleName, "Subscription");
db_set_resident(m_szModuleName, "Auth");
@@ -246,7 +246,7 @@ static COLORREF crCols[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
{
- HookEvent(ME_USERINFO_INITIALISE, &CJabberProto::OnUserInfoInit);
+ HookProtoEvent(ME_USERINFO_INITIALISE, &CJabberProto::OnUserInfoInit);
XStatusInit();
m_pepServices.InitGui();
@@ -265,8 +265,8 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
gcr.pszModule = m_szModuleName;
CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
- HookEvent(ME_GC_EVENT, &CJabberProto::JabberGcEventHook);
- HookEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook);
+ HookProtoEvent(ME_GC_EVENT, &CJabberProto::JabberGcEventHook);
+ HookProtoEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook);
}
HICON hIcon = LoadIconEx("main");
@@ -278,8 +278,8 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
Srmm_AddIcon(&sid);
Skin_ReleaseIcon(hIcon);
- HookEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick);
- HookEvent(ME_MSG_WINDOWEVENT, &CJabberProto::OnProcessSrmmEvent);
+ HookProtoEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick);
+ HookProtoEvent(ME_MSG_WINDOWEVENT, &CJabberProto::OnProcessSrmmEvent);
DBEVENTTYPEDESCR dbEventType = { sizeof(dbEventType) };
dbEventType.module = m_szModuleName;
@@ -291,7 +291,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
dbEventType.descr = "Presence notifications";
CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
- HookEvent(ME_IDLE_CHANGED, &CJabberProto::OnIdleChanged);
+ HookProtoEvent(ME_IDLE_CHANGED, &CJabberProto::OnIdleChanged);
CheckAllContactsAreTransported();
@@ -301,7 +301,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
if ( !getByte(hContact, "IsTransport", 0))
continue;
-
+
DBVARIANT dbv;
if ( !getTString(hContact, "jid", &dbv)) {
TCHAR *domain = NEWTSTR_ALLOCA(dbv.ptszVal);
@@ -700,7 +700,7 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
TCHAR jid[JABBER_MAX_JID_LEN];
if ( !GetClientJID(hContact, jid, SIZEOF(jid)))
return 1;
-
+
if (m_ThreadInfo) {
m_ThreadInfo->send(
XmlNodeIq(m_iqManager.AddHandler(&CJabberProto::OnIqResultEntityTime, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_HCONTACT))
diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h
index 1d6df272b0..da0a7f76be 100644
--- a/protocols/MRA/src/Mra.h
+++ b/protocols/MRA/src/Mra.h
@@ -63,6 +63,7 @@
#include <m_extraicons.h>
#include <m_music.h>
#include <m_xstatus.h>
+#include <m_nudge.h>
#include <m_proto_listeningto.h>
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp
index f4f0e0e3e1..beb07b9dcc 100644
--- a/protocols/MRA/src/MraChat.cpp
+++ b/protocols/MRA/src/MraChat.cpp
@@ -28,7 +28,7 @@ BOOL CMraProto::MraChatRegister()
gcr.pszModule = m_szModuleName;
CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
- HookEvent(ME_GC_EVENT, &CMraProto::MraChatGcEventHook);
+ HookProtoEvent(ME_GC_EVENT, &CMraProto::MraChatGcEventHook);
return TRUE;
}
diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h
index 7b4e35e3dd..021294e93a 100644
--- a/protocols/MRA/src/MraConstans.h
+++ b/protocols/MRA/src/MraConstans.h
@@ -114,11 +114,8 @@ static const LPSTR lpcszMailRuDomains[] =
#define MRA_ANSWERS_STR LPGENT("Answers")
#define MRA_WORLD "/World"
#define MRA_WORLD_STR LPGENT("World")
-#define MRA_SEND_NUDGE "/SendNudge"
-#define MS_NUDGE "/Nudge"
#define MRA_SENDNUDGE_STR LPGENT("Send &Nudge")
-
#define ADV_ICON_DELETED 0
#define ADV_ICON_DELETED_ID "ADV_ICON_DELETED"
#define ADV_ICON_DELETED_STR LPGENT("Mail box deleted")
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp
index 0bb4de9214..9cf3233c60 100644
--- a/protocols/MRA/src/MraIcons.cpp
+++ b/protocols/MRA/src/MraIcons.cpp
@@ -32,7 +32,7 @@ GUI_DISPLAY_ITEM gdiContactMenuItems[] =
{ MRA_VIEW_VIDEO, MRA_VIEW_VIDEO_STR, IDI_MRA_VIDEO, &CMraProto::MraViewVideo },
{ MRA_ANSWERS, MRA_ANSWERS_STR, IDI_MRA_ANSWERS, &CMraProto::MraAnswers },
{ MRA_WORLD, MRA_WORLD_STR, IDI_MRA_WORLD, &CMraProto::MraWorld },
- { MRA_SEND_NUDGE, MRA_SENDNUDGE_STR, IDI_MRA_ALARM, NULL }
+ { PS_SEND_NUDGE, MRA_SENDNUDGE_STR, IDI_MRA_ALARM, NULL }
};
GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
@@ -191,7 +191,7 @@ void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMain
for (size_t i = 0; i < dwCount; i++) {
memmove(pszServiceFunctionName, pgdiItems[i].lpszName, lstrlenA(pgdiItems[i].lpszName)+1);
if (pgdiItems[i].lpFunc)
- CreateService(pgdiItems[i].lpszName, pgdiItems[i].lpFunc);
+ CreateProtoService(pgdiItems[i].lpszName, pgdiItems[i].lpFunc);
mi.position = int(lPosition + i);
mi.icolibItem = pgdiItems[i].hIconHandle;
mi.ptszName = pgdiItems[i].lpwszDescr;
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp
index 86b9d52f04..f7dc6eb9c6 100644
--- a/protocols/MRA/src/MraProto.cpp
+++ b/protocols/MRA/src/MraProto.cpp
@@ -17,22 +17,22 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
MraMPopSessionQueueInitialize(&hMPopSessionQueue);
MraAvatarsQueueInitialize(&hAvatarsQueueHandle);
- CreateService(PS_SETCUSTOMSTATUSEX, &CMraProto::MraSetXStatusEx);
- CreateService(PS_GETCUSTOMSTATUSEX, &CMraProto::MraGetXStatusEx);
- CreateService(PS_GETCUSTOMSTATUSICON, &CMraProto::MraGetXStatusIcon);
+ CreateProtoService(PS_SETCUSTOMSTATUSEX, &CMraProto::MraSetXStatusEx);
+ CreateProtoService(PS_GETCUSTOMSTATUSEX, &CMraProto::MraGetXStatusEx);
+ CreateProtoService(PS_GETCUSTOMSTATUSICON, &CMraProto::MraGetXStatusIcon);
- CreateService(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo);
+ CreateProtoService(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo);
- CreateService(PS_CREATEACCMGRUI, &CMraProto::MraCreateAccMgrUI);
- CreateService(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps);
- CreateService(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo);
- CreateService(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar);
+ CreateProtoService(PS_CREATEACCMGRUI, &CMraProto::MraCreateAccMgrUI);
+ CreateProtoService(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps);
+ CreateProtoService(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo);
+ CreateProtoService(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar);
- CreateService(MS_ICQ_SENDSMS, &CMraProto::MraSendSMS);
- CreateService(MRA_SEND_NUDGE, &CMraProto::MraSendNudge);
+ CreateProtoService(MS_ICQ_SENDSMS, &CMraProto::MraSendSMS);
+ CreateProtoService(PS_SEND_NUDGE, &CMraProto::MraSendNudge);
if ( ServiceExists(MS_NUDGE_SEND))
- heNudgeReceived = CreateHookableEvent(MS_NUDGE);
+ heNudgeReceived = CreateProtoEvent(PE_NUDGE);
TCHAR name[128];
mir_sntprintf( name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName);
@@ -43,7 +43,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
nlu.ptszDescriptiveName = name;
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, &CMraProto::OnPreShutdown);
+ HookProtoEvent(ME_SYSTEM_PRESHUTDOWN, &CMraProto::OnPreShutdown);
InitContactMenu();
@@ -51,13 +51,13 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
for (size_t i = 0; i < MRA_XSTATUS_COUNT; i++) {
char szServiceName[100];
mir_snprintf(szServiceName, SIZEOF(szServiceName), "/menuXStatus%ld", i);
- CreateServiceParam(szServiceName, &CMraProto::MraXStatusMenu, i);
+ CreateProtoServiceParam(szServiceName, &CMraProto::MraXStatusMenu, i);
}
mir_snprintf(szNewMailSound, SIZEOF(szNewMailSound), "%s: %s", m_szModuleName, MRA_SOUND_NEW_EMAIL);
SkinAddNewSoundEx(szNewMailSound, m_szModuleName, MRA_SOUND_NEW_EMAIL);
- HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu);
+ HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu);
hExtraXstatusIcon = ExtraIcon_Register("MRAXstatus", LPGEN("Mail.ru Xstatus"), "mra_xstatus25");
hExtraInfo = ExtraIcon_Register("MRAStatus", LPGEN("Mail.ru extra info"), "mra_xstatus49");
@@ -91,12 +91,12 @@ INT_PTR CMraProto::MraCreateAccMgrUI(WPARAM wParam,LPARAM lParam)
int CMraProto::OnModulesLoaded(WPARAM, LPARAM)
{
- HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &CMraProto::MraExtraIconsApply);
- HookEvent(ME_OPT_INITIALISE, &CMraProto::OnOptionsInit);
- HookEvent(ME_DB_CONTACT_DELETED, &CMraProto::MraContactDeleted);
- HookEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMraProto::MraDbSettingChanged);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CMraProto::MraRebuildContactMenu);
- HookEvent(ME_WAT_NEWSTATUS, &CMraProto::MraMusicChanged);
+ HookProtoEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &CMraProto::MraExtraIconsApply);
+ HookProtoEvent(ME_OPT_INITIALISE, &CMraProto::OnOptionsInit);
+ HookProtoEvent(ME_DB_CONTACT_DELETED, &CMraProto::MraContactDeleted);
+ HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMraProto::MraDbSettingChanged);
+ HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CMraProto::MraRebuildContactMenu);
+ HookProtoEvent(ME_WAT_NEWSTATUS, &CMraProto::MraMusicChanged);
// всех в offline // тк unsaved values сохраняются их нужно инициализировать
for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
diff --git a/protocols/MSN/src/msn_global.h b/protocols/MSN/src/msn_global.h
index 33dc271cfc..99b4448964 100644
--- a/protocols/MSN/src/msn_global.h
+++ b/protocols/MSN/src/msn_global.h
@@ -65,6 +65,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_avatars.h>
#include <m_timezones.h>
#include <m_extraicons.h>
+#include <m_nudge.h>
#include "m_proto_listeningto.h"
#include "m_folders.h"
@@ -135,7 +136,6 @@ const char MSN_USER_AGENT[] = "Mozilla/4.0 (compatible; MSIE 8.0; Wind
#define MSN_INVITE "/InviteCommand"
#define MSN_NETMEETING "/NetMeeting"
#define MSN_VIEW_PROFILE "/ViewProfile"
-#define MSN_SEND_NUDGE "/SendNudge"
#define MS_GOTO_INBOX "/GotoInbox"
#define MS_EDIT_PROFILE "/EditProfile"
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 001efbb89a..f8f56c334a 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -307,35 +307,35 @@ void CMsnProto::MsnInitMainMenu(void)
mi.pszService = servicefunction;
strcpy(tDest, MS_SET_NICKNAME_UI);
- CreateService(MS_SET_NICKNAME_UI, &CMsnProto::SetNicknameUI);
+ CreateProtoService(MS_SET_NICKNAME_UI, &CMsnProto::SetNicknameUI);
mi.position = 201001;
mi.icolibItem = GetIconHandle(IDI_MSN);
mi.pszName = LPGEN("Set &Nickname");
menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MSN_INVITE);
- CreateService(MSN_INVITE, &CMsnProto::MsnInviteCommand);
+ CreateProtoService(MSN_INVITE, &CMsnProto::MsnInviteCommand);
mi.position = 201002;
mi.icolibItem = GetIconHandle(IDI_INVITE);
mi.pszName = LPGEN("Create &Chat");
menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_GOTO_INBOX);
- CreateService(MS_GOTO_INBOX, &CMsnProto::MsnGotoInbox);
+ CreateProtoService(MS_GOTO_INBOX, &CMsnProto::MsnGotoInbox);
mi.position = 201003;
mi.icolibItem = GetIconHandle(IDI_INBOX);
mi.pszName = LPGEN("Display &Hotmail Inbox");
menuItemsMain[1] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_EDIT_PROFILE);
- CreateService(MS_EDIT_PROFILE, &CMsnProto::MsnEditProfile);
+ CreateProtoService(MS_EDIT_PROFILE, &CMsnProto::MsnEditProfile);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("View &Profile");
menuItemsMain[2] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_EDIT_ALERTS);
- CreateService(MS_EDIT_ALERTS, &CMsnProto::MsnSetupAlerts);
+ CreateProtoService(MS_EDIT_ALERTS, &CMsnProto::MsnSetupAlerts);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("Setup Live &Alerts");
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 9e8390c03e..6ea0c131b7 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -51,32 +51,32 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
db_set_resident(m_szModuleName, "MobileAllowed");
// Protocol services and events...
- hMSNNudge = CreateHookableEvent("/Nudge");
+ hMSNNudge = CreateProtoEvent("/Nudge");
- CreateService(PS_CREATEACCMGRUI, &CMsnProto::SvcCreateAccMgrUI);
+ CreateProtoService(PS_CREATEACCMGRUI, &CMsnProto::SvcCreateAccMgrUI);
- CreateService(PS_GETAVATARINFOT, &CMsnProto::GetAvatarInfo);
- CreateService(PS_GETMYAWAYMSG, &CMsnProto::GetMyAwayMsg);
+ CreateProtoService(PS_GETAVATARINFOT, &CMsnProto::GetAvatarInfo);
+ CreateProtoService(PS_GETMYAWAYMSG, &CMsnProto::GetMyAwayMsg);
- CreateService(PS_LEAVECHAT, &CMsnProto::OnLeaveChat);
+ CreateProtoService(PS_LEAVECHAT, &CMsnProto::OnLeaveChat);
- CreateService(PS_GETMYAVATART, &CMsnProto::GetAvatar);
- CreateService(PS_SETMYAVATART, &CMsnProto::SetAvatar);
- CreateService(PS_GETAVATARCAPS, &CMsnProto::GetAvatarCaps);
+ CreateProtoService(PS_GETMYAVATART, &CMsnProto::GetAvatar);
+ CreateProtoService(PS_SETMYAVATART, &CMsnProto::SetAvatar);
+ CreateProtoService(PS_GETAVATARCAPS, &CMsnProto::GetAvatarCaps);
- CreateService(PS_GET_LISTENINGTO, &CMsnProto::GetCurrentMedia);
- CreateService(PS_SET_LISTENINGTO, &CMsnProto::SetCurrentMedia);
+ CreateProtoService(PS_GET_LISTENINGTO, &CMsnProto::GetCurrentMedia);
+ CreateProtoService(PS_SET_LISTENINGTO, &CMsnProto::SetCurrentMedia);
- CreateService(PS_SETMYNICKNAME, &CMsnProto::SetNickName);
- CreateService(MSN_SEND_NUDGE, &CMsnProto::SendNudge);
+ CreateProtoService(PS_SETMYNICKNAME, &CMsnProto::SetNickName);
+ CreateProtoService(PS_SEND_NUDGE, &CMsnProto::SendNudge);
- CreateService(MSN_GETUNREAD_EMAILCOUNT, &CMsnProto::GetUnreadEmailCount);
+ CreateProtoService(MSN_GETUNREAD_EMAILCOUNT, &CMsnProto::GetUnreadEmailCount);
// event hooks
- HookEvent(ME_MSG_WINDOWPOPUP, &CMsnProto::OnWindowPopup);
- HookEvent(ME_CLIST_GROUPCHANGE, &CMsnProto::OnGroupChange);
- HookEvent(ME_OPT_INITIALISE, &CMsnProto::OnOptionsInit);
- HookEvent(ME_CLIST_DOUBLECLICKED, &CMsnProto::OnContactDoubleClicked);
+ HookProtoEvent(ME_MSG_WINDOWPOPUP, &CMsnProto::OnWindowPopup);
+ HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMsnProto::OnGroupChange);
+ HookProtoEvent(ME_OPT_INITIALISE, &CMsnProto::OnOptionsInit);
+ HookProtoEvent(ME_CLIST_DOUBLECLICKED, &CMsnProto::OnContactDoubleClicked);
LoadOptions();
@@ -192,11 +192,11 @@ int CMsnProto::OnModulesLoaded(WPARAM, LPARAM)
gcr.pszModule = m_szModuleName;
CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
- HookEvent(ME_GC_EVENT, &CMsnProto::MSN_GCEventHook);
- HookEvent(ME_GC_BUILDMENU, &CMsnProto::MSN_GCMenuHook);
+ HookProtoEvent(ME_GC_EVENT, &CMsnProto::MSN_GCEventHook);
+ HookProtoEvent(ME_GC_BUILDMENU, &CMsnProto::MSN_GCMenuHook);
}
- HookEvent(ME_IDLE_CHANGED, &CMsnProto::OnIdleChanged);
+ HookProtoEvent(ME_IDLE_CHANGED, &CMsnProto::OnIdleChanged);
InitPopups();
return 0;
}
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp
index 839b0d549d..c6f0bef34a 100644
--- a/protocols/Omegle/src/proto.cpp
+++ b/protocols/Omegle/src/proto.cpp
@@ -33,13 +33,13 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) :
this->facy.connection_lock_ = CreateMutex( NULL, FALSE, NULL );
// Group chats
- CreateService(PS_JOINCHAT, &OmegleProto::OnJoinChat);
- CreateService(PS_LEAVECHAT, &OmegleProto::OnLeaveChat);
+ CreateProtoService(PS_JOINCHAT, &OmegleProto::OnJoinChat);
+ CreateProtoService(PS_LEAVECHAT, &OmegleProto::OnLeaveChat);
- CreateService(PS_CREATEACCMGRUI, &OmegleProto::SvcCreateAccMgrUI);
+ CreateProtoService(PS_CREATEACCMGRUI, &OmegleProto::SvcCreateAccMgrUI);
- HookEvent(ME_OPT_INITIALISE, &OmegleProto::OnOptionsInit);
- HookEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent);
+ HookProtoEvent(ME_OPT_INITIALISE, &OmegleProto::OnOptionsInit);
+ HookProtoEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent);
// Create standard network connection
TCHAR descr[512];
diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp
index 57339feb7e..67b2f71d57 100644
--- a/protocols/Skype/src/skype_chat.cpp
+++ b/protocols/Skype/src/skype_chat.cpp
@@ -89,8 +89,8 @@ void CSkypeProto::InitChatModule()
gcr.pszModule = this->m_szModuleName;
::CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
- this->HookEvent(ME_GC_EVENT, &CSkypeProto::OnGCEventHook);
- this->HookEvent(ME_GC_BUILDMENU, &CSkypeProto::OnGCMenuHook);
+ this->HookProtoEvent(ME_GC_EVENT, &CSkypeProto::OnGCEventHook);
+ this->HookProtoEvent(ME_GC_BUILDMENU, &CSkypeProto::OnGCMenuHook);
}
///
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp
index 7b1db8fa82..4c7cb48dc9 100644
--- a/protocols/Skype/src/skype_events.cpp
+++ b/protocols/Skype/src/skype_events.cpp
@@ -37,7 +37,7 @@ int CSkypeProto::OnProtoModulesLoaded(WPARAM, LPARAM)
bbd.dwDefPos = 100 + bbd.dwButtonID;
::CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
- this->HookEvent(ME_MSG_WINDOWEVENT, &CSkypeProto::OnSrmmWindowOpen);
+ this->HookProtoEvent(ME_MSG_WINDOWEVENT, &CSkypeProto::OnSrmmWindowOpen);
}
return 0;
diff --git a/protocols/Skype/src/skype_hooks.cpp b/protocols/Skype/src/skype_hooks.cpp
index 9e8f189863..13dc08c95b 100644
--- a/protocols/Skype/src/skype_hooks.cpp
+++ b/protocols/Skype/src/skype_hooks.cpp
@@ -8,10 +8,10 @@ void CSkypeProto::InitHookList()
void CSkypeProto::InitInstanceHookList()
{
- this->HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
- this->HookEvent(ME_USERINFO_INITIALISE, &CSkypeProto::OnUserInfoInit);
+ this->HookProtoEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
+ this->HookProtoEvent(ME_USERINFO_INITIALISE, &CSkypeProto::OnUserInfoInit);
- this->HookEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnMessagePreCreate);
+ this->HookProtoEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnMessagePreCreate);
- this->HookEvent(ME_MSG_BUTTONPRESSED, &CSkypeProto::OnTabSRMMButtonPressed);
+ this->HookProtoEvent(ME_MSG_BUTTONPRESSED, &CSkypeProto::OnTabSRMMButtonPressed);
}
diff --git a/protocols/Skype/src/skype_menus.cpp b/protocols/Skype/src/skype_menus.cpp
index 4ff59cf601..69e4acce52 100644
--- a/protocols/Skype/src/skype_menus.cpp
+++ b/protocols/Skype/src/skype_menus.cpp
@@ -256,7 +256,7 @@ void CSkypeProto::OnInitStatusMenu()
// Invite Command
::strcpy(tDest, "/CreateChatRoom");
- this->CreateService(tDest, &CSkypeProto::CreateChatRoomCommand);
+ this->CreateProtoService(tDest, &CSkypeProto::CreateChatRoomCommand);
mi.ptszName = LPGENT("Create conference");
mi.position = 200000 + SMI_CHAT_CREATE;
mi.icolibItem = CSkypeProto::GetSkinIconHandle("conference");
@@ -264,7 +264,7 @@ void CSkypeProto::OnInitStatusMenu()
// Invite Command
::strcpy(tDest, "/BlockedeList");
- this->CreateService(tDest, &CSkypeProto::OpenBlockedListCommand);
+ this->CreateProtoService(tDest, &CSkypeProto::OpenBlockedListCommand);
mi.ptszName = LPGENT("Blocked contacts");
mi.position = 200000 + SMI_IGNORE_LIST;
mi.icolibItem = CSkypeProto::GetSkinIconHandle("block");
diff --git a/protocols/Skype/src/skype_services.cpp b/protocols/Skype/src/skype_services.cpp
index e6bdf123c0..9f2ac62434 100644
--- a/protocols/Skype/src/skype_services.cpp
+++ b/protocols/Skype/src/skype_services.cpp
@@ -9,17 +9,17 @@ void CSkypeProto::InitServiceList()
void CSkypeProto::InitInstanceServiceList()
{
// Message API
- this->CreateService(PS_CREATEACCMGRUI, &CSkypeProto::OnAccountManagerInit);
+ this->CreateProtoService(PS_CREATEACCMGRUI, &CSkypeProto::OnAccountManagerInit);
// Chat API
- this->CreateService(PS_JOINCHAT, &CSkypeProto::OnJoinChat);
- this->CreateService(PS_LEAVECHAT, &CSkypeProto::OnLeaveChat);
+ this->CreateProtoService(PS_JOINCHAT, &CSkypeProto::OnJoinChat);
+ this->CreateProtoService(PS_LEAVECHAT, &CSkypeProto::OnLeaveChat);
// Own info
- this->CreateService(PS_SETMYNICKNAME, &CSkypeProto::SetMyNickName);
+ this->CreateProtoService(PS_SETMYNICKNAME, &CSkypeProto::SetMyNickName);
// Avatar API
- this->CreateService(PS_GETAVATARINFOT, &CSkypeProto::GetAvatarInfo);
- this->CreateService(PS_GETAVATARCAPS, &CSkypeProto::GetAvatarCaps);
- this->CreateService(PS_GETMYAVATART, &CSkypeProto::GetMyAvatar);
- this->CreateService(PS_SETMYAVATART, &CSkypeProto::SetMyAvatar);
+ this->CreateProtoService(PS_GETAVATARINFOT, &CSkypeProto::GetAvatarInfo);
+ this->CreateProtoService(PS_GETAVATARCAPS, &CSkypeProto::GetAvatarCaps);
+ this->CreateProtoService(PS_GETMYAVATART, &CSkypeProto::GetMyAvatar);
+ this->CreateProtoService(PS_SETMYAVATART, &CSkypeProto::SetMyAvatar);
// service to get from protocol chat buddy info
- this->CreateService(MS_GC_PROTO_GETTOOLTIPTEXT, &CSkypeProto::SkypeGCGetToolTipText);
+ this->CreateProtoService(MS_GC_PROTO_GETTOOLTIPTEXT, &CSkypeProto::SkypeGCGetToolTipText);
}
diff --git a/protocols/Tlen/src/jabber.h b/protocols/Tlen/src/jabber.h
index 7727eb799b..c62d1110e5 100644
--- a/protocols/Tlen/src/jabber.h
+++ b/protocols/Tlen/src/jabber.h
@@ -81,6 +81,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_skin.h>
#include <m_popup.h>
#include <m_avatars.h>
+#include <m_nudge.h>
#include "jabber_xml.h"
#include "crypto/polarssl/aes.h"
diff --git a/protocols/Tlen/src/jabber_svc.cpp b/protocols/Tlen/src/jabber_svc.cpp
index 46ef0b78b5..43886efe9a 100644
--- a/protocols/Tlen/src/jabber_svc.cpp
+++ b/protocols/Tlen/src/jabber_svc.cpp
@@ -1243,7 +1243,7 @@ void TlenInitServicesVTbl(TlenProtocol *proto) {
sprintf(s, "%s%s", proto->m_szModuleName, PS_GETAVATARINFO);
CreateServiceFunction_Ex(s, proto, TlenGetAvatarInfo);
- sprintf(s, "%s%s", proto->m_szModuleName, "/SendNudge");
+ sprintf(s, "%s%s", proto->m_szModuleName, PS_SEND_NUDGE);
CreateServiceFunction_Ex(s, proto, TlenSendAlert);
sprintf(s, "%s%s", proto->m_szModuleName, PS_GETAVATARCAPS);
@@ -1273,7 +1273,7 @@ TlenProtocol::TlenProtocol( const char *aProtoName, const TCHAR *aUserName) :
char text[_MAX_PATH];
sprintf(text, "%s/%s", m_szModuleName, "Nudge");
- hTlenNudge = CreateHookableEvent(text);
+ hTlenNudge = CreateProtoEvent(text);
HookEventObj_Ex(ME_SYSTEM_MODULESLOADED, this, TlenSystemModulesLoaded);
HookEventObj_Ex(ME_OPT_INITIALISE, this, TlenOptionsInit);
diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp
index 5a03d293a7..2f0f186f8d 100644
--- a/protocols/Twitter/src/chat.cpp
+++ b/protocols/Twitter/src/chat.cpp
@@ -156,7 +156,7 @@ INT_PTR TwitterProto::OnJoinChat(WPARAM,LPARAM suppress)
CallServiceSync(MS_GC_EVENT,0,reinterpret_cast<LPARAM>(&gce));
// ***** Hook events
- HookEvent(ME_GC_EVENT, &TwitterProto::OnChatOutgoing);
+ HookProtoEvent(ME_GC_EVENT, &TwitterProto::OnChatOutgoing);
// Note: Initialization will finish up in SetChatStatus, called separately
if(!suppress)
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index 659fee4fd2..4130ce44a3 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -34,19 +34,19 @@ static volatile LONG g_msgid = 1;
TwitterProto::TwitterProto(const char *proto_name,const TCHAR *username) :
PROTO<TwitterProto>(proto_name, username)
{
- CreateService(PS_CREATEACCMGRUI, &TwitterProto::SvcCreateAccMgrUI);
- CreateService(PS_GETNAME, &TwitterProto::GetName);
- CreateService(PS_GETSTATUS, &TwitterProto::GetStatus);
+ CreateProtoService(PS_CREATEACCMGRUI, &TwitterProto::SvcCreateAccMgrUI);
+ CreateProtoService(PS_GETNAME, &TwitterProto::GetName);
+ CreateProtoService(PS_GETSTATUS, &TwitterProto::GetStatus);
- CreateService(PS_JOINCHAT, &TwitterProto::OnJoinChat);
- CreateService(PS_LEAVECHAT, &TwitterProto::OnLeaveChat);
+ CreateProtoService(PS_JOINCHAT, &TwitterProto::OnJoinChat);
+ CreateProtoService(PS_LEAVECHAT, &TwitterProto::OnLeaveChat);
- CreateService(PS_GETMYAVATAR, &TwitterProto::GetAvatar);
- CreateService(PS_SETMYAVATAR, &TwitterProto::SetAvatar);
+ CreateProtoService(PS_GETMYAVATAR, &TwitterProto::GetAvatar);
+ CreateProtoService(PS_SETMYAVATAR, &TwitterProto::SetAvatar);
- HookEvent(ME_DB_CONTACT_DELETED, &TwitterProto::OnContactDeleted);
- HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &TwitterProto::OnBuildStatusMenu);
- HookEvent(ME_OPT_INITIALISE, &TwitterProto::OnOptionsInit);
+ HookProtoEvent(ME_DB_CONTACT_DELETED, &TwitterProto::OnContactDeleted);
+ HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &TwitterProto::OnBuildStatusMenu);
+ HookProtoEvent(ME_OPT_INITIALISE, &TwitterProto::OnOptionsInit);
tstring defFolder = std::tstring( _T("%miranda_avatarcache%\\")) + m_tszUserName;
hAvatarFolder_ = FoldersRegisterCustomPathT(LPGEN("Avatars"), m_szModuleName, defFolder.c_str(), m_tszUserName);
@@ -308,7 +308,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM,LPARAM)
// TODO: Disable this menu item when offline
// "Send Tweet..."
- CreateService("/Tweet", &TwitterProto::OnTweet);
+ CreateProtoService("/Tweet", &TwitterProto::OnTweet);
strcpy(tDest,"/Tweet");
mi.ptszName = LPGENT("Send Tweet...");
mi.popupPosition = 200001;
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index 5c2ffad18f..1872fc21b8 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -10,12 +10,12 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) :
update_loop_lock_ = CreateEvent(NULL, false, false, NULL);
FMessage::generating_lock = new Mutex();
- CreateService(PS_CREATEACCMGRUI, &WhatsAppProto::SvcCreateAccMgrUI);
- CreateService(PS_JOINCHAT, &WhatsAppProto::OnJoinChat);
- CreateService(PS_LEAVECHAT, &WhatsAppProto::OnLeaveChat);
+ CreateProtoService(PS_CREATEACCMGRUI, &WhatsAppProto::SvcCreateAccMgrUI);
+ CreateProtoService(PS_JOINCHAT, &WhatsAppProto::OnJoinChat);
+ CreateProtoService(PS_LEAVECHAT, &WhatsAppProto::OnLeaveChat);
- HookEvent(ME_GC_EVENT, &WhatsAppProto::OnChatOutgoing);
- HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu);
+ HookProtoEvent(ME_GC_EVENT, &WhatsAppProto::OnChatOutgoing);
+ HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu);
this->InitContactMenus();
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp
index d292cf80a8..1738577262 100644
--- a/protocols/WhatsApp/src/theme.cpp
+++ b/protocols/WhatsApp/src/theme.cpp
@@ -252,7 +252,7 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam)
mi.flags = CMIF_CHILDPOPUP | ( this->isOnline() ? 0 : CMIF_GRAYED );
mi.position = 201001;
- CreateService("/CreateGroup", &WhatsAppProto::OnCreateGroup);
+ CreateProtoService("/CreateGroup", &WhatsAppProto::OnCreateGroup);
strcpy(tDest, "/CreateGroup");
mi.hParentMenu = hRoot;
mi.pszName = LPGEN("Create Group");
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp
index ae979eca78..d5a0010ff4 100644
--- a/protocols/Yahoo/src/chat.cpp
+++ b/protocols/Yahoo/src/chat.cpp
@@ -190,8 +190,8 @@ void CYahooProto::ChatRegister(void)
gcr.pszModule = m_szModuleName;
CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
- HookEvent(ME_GC_EVENT, &CYahooProto::OnGCEventHook);
- HookEvent(ME_GC_BUILDMENU, &CYahooProto::OnGCMenuHook);
+ HookProtoEvent(ME_GC_EVENT, &CYahooProto::OnGCEventHook);
+ HookProtoEvent(ME_GC_BUILDMENU, &CYahooProto::OnGCMenuHook);
}
void CYahooProto::ChatStart(const char* room)
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index 4849eb034a..cc7e27f968 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -68,9 +68,9 @@ CYahooProto::~CYahooProto()
int CYahooProto::OnModulesLoadedEx( WPARAM, LPARAM )
{
- HookEvent( ME_USERINFO_INITIALISE, &CYahooProto::OnUserInfoInit );
- HookEvent( ME_IDLE_CHANGED, &CYahooProto::OnIdleEvent);
- HookEvent( ME_CLIST_PREBUILDCONTACTMENU, &CYahooProto::OnPrebuildContactMenu );
+ HookProtoEvent( ME_USERINFO_INITIALISE, &CYahooProto::OnUserInfoInit );
+ HookProtoEvent( ME_IDLE_CHANGED, &CYahooProto::OnIdleEvent);
+ HookProtoEvent( ME_CLIST_PREBUILDCONTACTMENU, &CYahooProto::OnPrebuildContactMenu );
TCHAR tModuleDescr[ 100 ];
mir_sntprintf(tModuleDescr, SIZEOF(tModuleDescr), TranslateT("%s plugin connections"), m_tszUserName);
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp
index 2a69c8ee9f..d8fdc1883a 100644
--- a/protocols/Yahoo/src/services.cpp
+++ b/protocols/Yahoo/src/services.cpp
@@ -1,9 +1,9 @@
/*
* $Id: services.cpp 14142 2012-03-09 21:11:27Z george.hazan $
*
- * myYahoo Miranda Plugin
+ * myYahoo Miranda Plugin
*
- * Authors: Gennady Feldman (aka Gena01)
+ * Authors: Gennady Feldman (aka Gena01)
* Laurent Marechal (aka Peorth)
*
* This code is under GPL and is based on AIM, MSN and Miranda source code.
@@ -20,6 +20,7 @@
#include <m_utils.h>
#include <m_options.h>
#include <m_popup.h>
+#include <m_nudge.h>
#include "avatar.h"
#include "resource.h"
@@ -38,7 +39,7 @@ void CYahooProto::logoff_buddies()
db_unset(hContact, "CList", "StatusMsg");
delSetting(hContact, "YMsg");
delSetting(hContact, "YGMsg");
- }
+ }
}
//=======================================================
@@ -72,7 +73,7 @@ void CYahooProto::BroadcastStatus(int s)
DebugLog("[yahoo_util_broadcaststatus] Old Status: %s (%d), New Status: %s (%d)",
NEWSTR_ALLOCA((char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, oldStatus, 0)), oldStatus,
- NEWSTR_ALLOCA((char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, m_iStatus, 0)), m_iStatus);
+ NEWSTR_ALLOCA((char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, m_iStatus, 0)), m_iStatus);
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, (LPARAM)m_iStatus);
}
@@ -83,9 +84,9 @@ int __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam )
{
DBVARIANT dbv;
HANDLE hContact = (HANDLE) wParam;
-
+
DebugLog("[YahooContactDeleted]");
-
+
if ( !m_bLoggedIn ) {//should never happen for Yahoo contacts
DebugLog("[YahooContactDeleted] We are not Logged On!!!");
return 0;
@@ -96,11 +97,11 @@ int __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam )
DebugLog("[YahooContactDeleted] Not a permanent buddy!!!");
return 0;
}
-
+
if (!getString(hContact, YAHOO_LOGINID, &dbv)) {
DebugLog("[YahooContactDeleted] Removing %s", dbv.pszVal);
remove_buddy(dbv.pszVal, getWord(hContact, "yprotoid", 0));
-
+
db_free(&dbv);
} else {
DebugLog("[YahooContactDeleted] Can't retrieve contact Yahoo ID");
@@ -178,7 +179,7 @@ static INT_PTR CALLBACK DlgProcSetCustStat(HWND hwndDlg, UINT msg, WPARAM wParam
toSet = GetDlgItemTextA(hwndDlg, IDC_CUSTSTAT, str, sizeof( str )) != 0;
EnableWindow( GetDlgItem(hwndDlg, IDOK ), toSet );
- }
+ }
}
break; /* case WM_COMMAND */
@@ -203,7 +204,7 @@ INT_PTR __cdecl CYahooProto::SetCustomStatCommand( WPARAM wParam, LPARAM lParam
ShowNotification( TranslateT("Yahoo Error"), TranslateT("You need to be connected to set the custom message"), NIIF_ERROR);
return 0;
}
-
+
HWND hwndSetCustomStatus = CreateDialogParam(hInstance, MAKEINTRESOURCE( IDD_SETCUSTSTAT ), NULL, DlgProcSetCustStat, (LPARAM)this );
SetForegroundWindow( hwndSetCustomStatus );
SetFocus( hwndSetCustomStatus );
@@ -219,17 +220,17 @@ void CYahooProto::OpenURL(const char *url, int autoLogin)
char tUrl[ 4096 ];
DebugLog("[YahooOpenURL] url: %s Auto Login: %d", url, autoLogin);
-
+
if (autoLogin && getByte("MailAutoLogin", 0) && m_bLoggedIn && m_id > 0) {
char *y, *t, *u;
-
+
y = yahoo_urlencode(yahoo_get_cookie(m_id, "y"));
t = yahoo_urlencode(yahoo_get_cookie(m_id, "t"));
u = yahoo_urlencode(url);
- _snprintf( tUrl, sizeof( tUrl ),
+ _snprintf( tUrl, sizeof( tUrl ),
"http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.t=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s",
y, t, u);
-
+
FREE(y);
FREE(t);
FREE(u);
@@ -238,7 +239,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin)
}
DebugLog("[YahooOpenURL] url: %s Final URL: %s", url, tUrl);
-
+
CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)tUrl);
}
@@ -256,13 +257,13 @@ INT_PTR __cdecl CYahooProto::OnShowProfileCommand( WPARAM wParam, LPARAM lParam
if (getWord(( HANDLE )wParam, "yprotoid", 0) != 0) {
return 0;
}
-
+
if (getString((HANDLE)wParam, YAHOO_LOGINID, &dbv))
return 0;
-
+
_snprintf( tUrl, sizeof( tUrl ), "http://profiles.yahoo.com/%s", dbv.pszVal );
db_free(&dbv);
-
+
OpenURL(tUrl, 0);
return 0;
}
@@ -279,7 +280,7 @@ INT_PTR __cdecl CYahooProto::OnEditMyProfile( WPARAM wParam, LPARAM lParam )
INT_PTR __cdecl CYahooProto::OnShowMyProfileCommand( WPARAM wParam, LPARAM lParam )
{
DBVARIANT dbv;
-
+
if ( getString( YAHOO_LOGINID, &dbv) != 0) {
ShowError( TranslateT("Yahoo Error"), TranslateT("Please enter your yahoo id in Options/Network/Yahoo"));
return 0;
@@ -302,7 +303,7 @@ INT_PTR __cdecl CYahooProto::OnGotoMailboxCommand( WPARAM wParam, LPARAM lParam
OpenURL("http://mail.yahoo.co.jp/", 1);
else
OpenURL("http://mail.yahoo.com/", 1);
-
+
return 0;
}
@@ -314,7 +315,7 @@ INT_PTR __cdecl CYahooProto::OnABCommand( WPARAM wParam, LPARAM lParam )
INT_PTR __cdecl CYahooProto::OnCalendarCommand( WPARAM wParam, LPARAM lParam )
{
- OpenURL("http://calendar.yahoo.com/", 1);
+ OpenURL("http://calendar.yahoo.com/", 1);
return 0;
}
@@ -338,7 +339,7 @@ int __cdecl CYahooProto::OnIdleEvent(WPARAM wParam, LPARAM lParam)
DebugLog("[YAHOO_IDLE_EVENT] Idle: %s", bIdle ?"Yes":"No");
- if ( lParam & IDF_PRIVACY )
+ if ( lParam & IDF_PRIVACY )
return 0; /* we support Privacy settings */
if (m_bLoggedIn) {
@@ -369,7 +370,7 @@ void CYahooProto::MenuMainInit( void )
char servicefunction[ 100 ];
lstrcpyA( servicefunction, m_szModuleName);
char* tDest = servicefunction + lstrlenA( servicefunction );
-
+
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
@@ -387,23 +388,23 @@ void CYahooProto::MenuMainInit( void )
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)mainMenuRoot, 0);
mainMenuRoot = NULL;
}
-
+
mi.flags = CMIF_CHILDPOPUP;
mi.hParentMenu = hRoot;
-
- // Show custom status menu
+
+ // Show custom status menu
lstrcpyA( tDest, YAHOO_SET_CUST_STAT );
- CreateService( YAHOO_SET_CUST_STAT, &CYahooProto::SetCustomStatCommand );
-
+ CreateProtoService(YAHOO_SET_CUST_STAT, &CYahooProto::SetCustomStatCommand);
+
mi.position = 290000;
mi.icolibItem = GetIconHandle( IDI_SET_STATUS );
mi.pszName = LPGEN("Set &Custom Status");
-
+
menuItemsAll[0] = Menu_AddProtoMenuItem(&mi);
// Edit My profile
lstrcpyA( tDest, YAHOO_EDIT_MY_PROFILE );
- CreateService( YAHOO_EDIT_MY_PROFILE, &CYahooProto::OnEditMyProfile );
+ CreateProtoService(YAHOO_EDIT_MY_PROFILE, &CYahooProto::OnEditMyProfile);
mi.position = 290005;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
@@ -412,25 +413,25 @@ void CYahooProto::MenuMainInit( void )
// Show My profile
lstrcpyA( tDest, YAHOO_SHOW_MY_PROFILE );
- CreateService( YAHOO_SHOW_MY_PROFILE, &CYahooProto::OnShowMyProfileCommand );
+ CreateProtoService(YAHOO_SHOW_MY_PROFILE, &CYahooProto::OnShowMyProfileCommand);
mi.position = 290006;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN("&My Profile");
menuItemsAll[2] = Menu_AddProtoMenuItem(&mi);
- // Show Yahoo mail
+ // Show Yahoo mail
strcpy( tDest, YAHOO_YAHOO_MAIL );
- CreateService( YAHOO_YAHOO_MAIL, &CYahooProto::OnGotoMailboxCommand );
+ CreateProtoService(YAHOO_YAHOO_MAIL, &CYahooProto::OnGotoMailboxCommand);
mi.position = 290010;
mi.icolibItem = GetIconHandle( IDI_INBOX );
mi.pszName = LPGEN("&Yahoo Mail");
menuItemsAll[3] = Menu_AddProtoMenuItem(&mi);
- // Show Address Book
- strcpy( tDest, YAHOO_AB );
- CreateService( YAHOO_AB, &CYahooProto::OnABCommand );
+ // Show Address Book
+ strcpy(tDest, YAHOO_AB);
+ CreateProtoService(YAHOO_AB, &CYahooProto::OnABCommand);
mi.position = 290015;
mi.icolibItem = GetIconHandle( IDI_YAB );
@@ -439,14 +440,14 @@ void CYahooProto::MenuMainInit( void )
// Show Calendar
strcpy( tDest, YAHOO_CALENDAR );
- CreateService( YAHOO_CALENDAR, &CYahooProto::OnCalendarCommand );
+ CreateProtoService(YAHOO_CALENDAR, &CYahooProto::OnCalendarCommand);
mi.position = 290017;
mi.icolibItem = GetIconHandle( IDI_CALENDAR );
mi.pszName = LPGEN("&Calendar");
menuItemsAll[5] = Menu_AddProtoMenuItem(&mi);
strcpy( tDest, "/JoinChatRoom");
- CreateService("/JoinChatRoom", &CYahooProto::CreateConference);
+ CreateProtoService("/JoinChatRoom", &CYahooProto::CreateConference);
mi.position = 290018;
mi.icolibItem = GetIconHandle(IDI_YAHOO);
@@ -454,9 +455,9 @@ void CYahooProto::MenuMainInit( void )
menuItemsAll[6] = Menu_AddProtoMenuItem(&mi);
- // Show Refresh
+ // Show Refresh
/*strcpy( tDest, YAHOO_REFRESH );
- CreateService( YAHOO_REFRESH, &CYahooProto::OnRefreshCommand );
+ CreateProtoService(YAHOO_REFRESH, &CYahooProto::OnRefreshCommand);
mi.position = 500090015;
mi.icolibItem = GetIconHandle( IDI_REFRESH );
@@ -464,33 +465,33 @@ void CYahooProto::MenuMainInit( void )
menuItemsAll[7] = Menu_AddProtoMenuItem(&mi);
*/
}
-
+
void CYahooProto::MenuContactInit( void )
{
char servicefunction[ 100 ];
lstrcpyA( servicefunction, m_szModuleName);
char* tDest = servicefunction + lstrlenA( servicefunction );
-
+
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
mi.pszContactOwner = m_szModuleName;
- // Show Profile
+ // Show Profile
strcpy( tDest, YAHOO_SHOW_PROFILE );
- CreateService( YAHOO_SHOW_PROFILE, &CYahooProto::OnShowProfileCommand );
+ CreateProtoService(YAHOO_SHOW_PROFILE, &CYahooProto::OnShowProfileCommand );
mi.position = -2000006000;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN("&Show Profile");
hShowProfileMenuItem = Menu_AddContactMenuItem(&mi);
-
+
}
void CYahooProto::MenuUninit( void )
{
if ( mainMenuRoot )
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)mainMenuRoot, 0);
-
+
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hShowProfileMenuItem, 0);
}
@@ -512,30 +513,27 @@ int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
//=======================================================================================
void CYahooProto::LoadYahooServices( void )
{
- char path[MAX_PATH];
-
//----| Events hooking |--------------------------------------------------------------
- HookEvent( ME_OPT_INITIALISE, &CYahooProto::OnOptionsInit );
+ HookProtoEvent(ME_OPT_INITIALISE, &CYahooProto::OnOptionsInit);
//----| Create nudge event |----------------------------------------------------------
- mir_snprintf(path, SIZEOF(path), "%s/Nudge", m_szModuleName);
- hYahooNudge = CreateHookableEvent( path );
+ hYahooNudge = CreateProtoEvent(PE_NUDGE);
//----| Service creation |------------------------------------------------------------
- CreateService( PS_CREATEACCMGRUI, &CYahooProto::SvcCreateAccMgrUI);
-
- CreateService( PS_GETAVATARINFOT, &CYahooProto::GetAvatarInfo );
- CreateService( PS_GETMYAVATART, &CYahooProto::GetMyAvatar );
- CreateService( PS_SETMYAVATART, &CYahooProto::SetMyAvatar );
- CreateService( PS_GETAVATARCAPS, &CYahooProto::GetAvatarCaps );
-
- CreateService( PS_GETMYAWAYMSG, &CYahooProto::GetMyAwayMsg);
- CreateService( YAHOO_SEND_NUDGE, &CYahooProto::SendNudge );
-
- CreateService( YAHOO_GETUNREAD_EMAILCOUNT, &CYahooProto::GetUnreadEmailCount);
+ CreateProtoService(PS_CREATEACCMGRUI, &CYahooProto::SvcCreateAccMgrUI);
+
+ CreateProtoService(PS_GETAVATARINFOT, &CYahooProto::GetAvatarInfo);
+ CreateProtoService(PS_GETMYAVATART, &CYahooProto::GetMyAvatar);
+ CreateProtoService(PS_SETMYAVATART, &CYahooProto::SetMyAvatar);
+ CreateProtoService(PS_GETAVATARCAPS, &CYahooProto::GetAvatarCaps);
+
+ CreateProtoService(PS_GETMYAWAYMSG, &CYahooProto::GetMyAwayMsg);
+ CreateProtoService(PS_SEND_NUDGE, &CYahooProto::SendNudge);
+
+ CreateProtoService(YAHOO_GETUNREAD_EMAILCOUNT, &CYahooProto::GetUnreadEmailCount);
//----| Set resident variables |------------------------------------------------------
-
+
db_set_resident(m_szModuleName, "Mobile");
db_set_resident(m_szModuleName, "IdleTS");
db_set_resident(m_szModuleName, "PictLastCheck");
diff --git a/protocols/Yahoo/src/yahoo.h b/protocols/Yahoo/src/yahoo.h
index 6c2c6b81f2..5c17ed2f5a 100644
--- a/protocols/Yahoo/src/yahoo.h
+++ b/protocols/Yahoo/src/yahoo.h
@@ -90,7 +90,6 @@ extern int do_yahoo_debug;
#define YAHOO_REFRESH "/YahooRefreshCommand"
#define YAHOO_AB "/YahooAddressBook"
#define YAHOO_CALENDAR "/YahooCalendar"
-#define YAHOO_SEND_NUDGE "/SendNudge"
#define YAHOO_GETUNREAD_EMAILCOUNT "/GetUnreadEmailCount"
#define STYLE_DEFAULTBGCOLOUR RGB(173,206,247)