summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-28 11:05:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-28 11:05:10 +0000
commit90c2f2a24e911c832e11fcc6443afd24efdd4cc9 (patch)
tree719972a0755925073ab6aeb7aa24e92eed5b1427 /protocols/JabberG/src
parentf302909f341c5bf61bcb432d73443df6c3ba44c9 (diff)
- fix for name conflict in proto helpers;
- switch to constants defined in m_nudge.h git-svn-id: http://svn.miranda-ng.org/main/trunk@5504 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
-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
4 files changed, 56 insertions, 59 deletions
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))