summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/msgs.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-25 12:54:45 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-25 12:54:45 +0000
commitbd8a04455d9c991c15df2287e091abe4ba054efb (patch)
tree6af5485d60feef741669eb545a6378e7c209ab59 /plugins/Scriver/src/msgs.cpp
parent7fdce14cd488e25e8e32e34098fbe9f5cb3021b7 (diff)
typed stub for MS_PROTO_GETCONTACTBASEPROTO
git-svn-id: http://svn.miranda-ng.org/main/trunk@2480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/msgs.cpp')
-rw-r--r--plugins/Scriver/src/msgs.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 7708b6c1c0..1a9450776e 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -63,12 +63,11 @@ static int SRMMStatusToPf2(int status)
int IsAutoPopup(HANDLE hContact) {
if (g_dat->flags & SMF_AUTOPOPUP) {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (strcmp(szProto, "MetaContacts") == 0 ) {
hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact, 0);
- if (hContact != NULL) {
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- }
+ if (hContact != NULL)
+ szProto = GetContactProto(hContact);
}
if (szProto && (g_dat->openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) {
return 1;
@@ -150,18 +149,13 @@ static INT_PTR SendMessageCommandW(WPARAM wParam, LPARAM lParam)
HWND hwnd;
NewMessageWindowLParam newData = { 0 };
- {
- /* does the HCONTACT's protocol support IM messages? */
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
- if (szProto) {
- if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
- return 1;
- }
- else {
- /* unknown contact */
- return 1;
- } //if
- }
+ /* does the HCONTACT's protocol support IM messages? */
+ char *szProto = GetContactProto((HANDLE)wParam);
+ if (szProto == NULL)
+ return 1; /* unknown contact */
+
+ if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
+ return 1;
if ((hwnd = WindowList_Find(g_dat->hMessageWindowList, (HANDLE) wParam))) {
if (lParam) {
@@ -194,7 +188,7 @@ static INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
NewMessageWindowLParam newData = { 0 };
{
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
//logInfo("Show message window for: %s (%s)", CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, 0), szProto);
if (szProto) {
/* does the HCONTACT's protocol support IM messages? */
@@ -284,7 +278,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam)
static int MessageSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
return 0;
WindowList_Broadcast(g_dat->hMessageWindowList, DM_CLISTSETTINGSCHANGED, wParam, lParam);
@@ -385,7 +379,7 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
if ( hContact ) {
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
CLISTMENUITEM clmi = {0};
clmi.cbSize = sizeof(CLISTMENUITEM);