summaryrefslogtreecommitdiff
path: root/plugins/MetaContacts
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 /plugins/MetaContacts
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 'plugins/MetaContacts')
-rw-r--r--plugins/MetaContacts/src/meta_menu.cpp16
-rwxr-xr-xplugins/MetaContacts/src/meta_services.cpp6
-rw-r--r--plugins/MetaContacts/src/metacontacts.h1
3 files changed, 12 insertions, 11 deletions
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp
index e32f4ae75a..fecb0520fe 100644
--- a/plugins/MetaContacts/src/meta_menu.cpp
+++ b/plugins/MetaContacts/src/meta_menu.cpp
@@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/** @file meta_menu.c
+/** @file meta_menu.c
*
* Functions needed to handle MetaContacts.
* Centralizes functions called when the user chooses
@@ -40,7 +40,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
char *group = 0;
-
+
// Get some information about the selected contact.
if ( !db_get_utf((HANDLE)wParam, "CList", "Group", &dbv)) {
group = _strdup(dbv.pszVal);
@@ -59,7 +59,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam)
if (group)
db_set_utf(hMetaContact, "CList", "Group", group);
-
+
// Assign the contact to the MetaContact just created (and make default).
if ( !Meta_Assign((HANDLE)wParam, hMetaContact, TRUE)) {
MessageBox(0, TranslateT("There was a problem in assigning the contact to the MetaContact"), TranslateT("Error"), MB_ICONEXCLAMATION);
@@ -164,7 +164,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number)
// if the default contact was equal to or greater than 'number', decrement it (and deal with ends)
if (default_contact >= number) {
default_contact--;
- if (default_contact < 0)
+ if (default_contact < 0)
default_contact = 0;
db_set_dw(hMeta, META_PROTO, "Default", (DWORD)default_contact);
@@ -209,7 +209,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
// The wParam is a metacontact
if ((metaID = db_get_dw((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1)) != (DWORD)-1) {
if ( !lParam) { // check from recursion - see second half of this function
- if ( MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0),
+ if ( MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0),
TranslateT("This will remove the MetaContact permanently.\n\nProceed Anyway?"),
TranslateT("Are you sure?"),MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) != IDYES)
return 0;
@@ -320,7 +320,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) {
// save the mouse pos in case they open a subcontact menu
GetCursorPos(&menuMousePoint);
-
+
// This is a MetaContact, show the edit, force default, and the delete menu, and hide the others
Menu_ShowItem(hMenuEdit, true);
Menu_ShowItem(hMenuAdd, false);
@@ -339,7 +339,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
Menu_ShowItem(hMenuContact[i], false);
continue;
}
-
+
HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i);
char *szProto = GetContactProto(hContact);
if ( !szProto)
@@ -391,7 +391,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
// wParam = char *szProto
// lParam = BOOL show
char serviceFunc[256];
- mir_snprintf(serviceFunc, 256, "%s/SendNudge", GetContactProto( Meta_GetMostOnline((HANDLE)wParam)));
+ mir_snprintf(serviceFunc, 256, "%s%s", GetContactProto( Meta_GetMostOnline((HANDLE)wParam)), PS_SEND_NUDGE);
CallService(MS_NUDGE_SHOWMENU, (WPARAM)META_PROTO, (LPARAM)ServiceExists(serviceFunc));
}
else { // This is a simple contact
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index 55562a2f84..0bc80c7254 100755
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -262,7 +262,7 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
INT_PTR Meta_SendNudge(WPARAM wParam,LPARAM lParam)
{
HANDLE hSubContact = Meta_GetMostOnline((HANDLE)wParam);
- return ProtoCallService(GetContactProto(hSubContact), "/SendNudge", (WPARAM)hSubContact, lParam);
+ return ProtoCallService(GetContactProto(hSubContact), PS_SEND_NUDGE, (WPARAM)hSubContact, lParam);
}
/////////////////////////////////////////////////////////////////
@@ -1284,7 +1284,7 @@ INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam)
ccs->hContact = most_online;
if ( !ProtoServiceExists(proto, PSS_GETINFO))
return 0; // fail
-
+
return CallContactService(ccs->hContact, PSS_GETINFO, ccs->wParam, ccs->lParam);
}
@@ -1445,7 +1445,7 @@ void Meta_InitServices()
CreateServiceFunction("MetaContacts/OnOff", Meta_OnOff);
CreateServiceFunction("MetaContacts/CListMessageEvent", Meta_ClistMessageEventClicked);
- CreateProtoServiceFunction(META_PROTO, "/SendNudge", Meta_SendNudge);
+ CreateProtoServiceFunction(META_PROTO, PS_SEND_NUDGE, Meta_SendNudge);
// create our hookable events
hEventDefaultChanged = CreateHookableEvent(ME_MC_DEFAULTTCHANGED);
diff --git a/plugins/MetaContacts/src/metacontacts.h b/plugins/MetaContacts/src/metacontacts.h
index 680b8c78b5..a7fb25823c 100644
--- a/plugins/MetaContacts/src/metacontacts.h
+++ b/plugins/MetaContacts/src/metacontacts.h
@@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_ignore.h>
#include <m_icolib.h>
#include <m_langpack.h>
+#include <m_nudge.h>
#include <win2k.h>
#include <m_metacontacts.h>