summaryrefslogtreecommitdiff
path: root/src/core/stdfile
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 /src/core/stdfile
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 'src/core/stdfile')
-rw-r--r--src/core/stdfile/file.cpp6
-rw-r--r--src/core/stdfile/filerecvdlg.cpp15
-rw-r--r--src/core/stdfile/filesenddlg.cpp6
-rw-r--r--src/core/stdfile/filexferdlg.cpp6
4 files changed, 14 insertions, 19 deletions
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp
index 5fa7d5ae22..dfb77b086b 100644
--- a/src/core/stdfile/file.cpp
+++ b/src/core/stdfile/file.cpp
@@ -32,7 +32,7 @@ static HANDLE hSRFileMenuItem;
TCHAR *GetContactID(HANDLE hContact)
{
TCHAR *theValue = {0};
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 1) {
DBVARIANT dbv;
if ( !DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv)) {
@@ -312,7 +312,7 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM)
mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto != NULL) {
if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_FILESEND) {
if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_OFFLINEFILES)
@@ -396,7 +396,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
- dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
+ dbei.szModule = GetContactProto(ccs->hContact);
dbei.timestamp = pre->timestamp;
dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
dbei.eventType = EVENTTYPE_FILE;
diff --git a/src/core/stdfile/filerecvdlg.cpp b/src/core/stdfile/filerecvdlg.cpp
index 6b4ce2e743..6492530004 100644
--- a/src/core/stdfile/filerecvdlg.cpp
+++ b/src/core/stdfile/filerecvdlg.cpp
@@ -154,7 +154,7 @@ void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL
rvaVarsToReplace[1].lptzKey = _T("userid");
rvaVarsToReplace[1].lptzValue = GetContactID(hContact);
rvaVarsToReplace[2].lptzKey = _T("proto");
- rvaVarsToReplace[2].lptzValue = mir_a2t((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
+ rvaVarsToReplace[2].lptzValue = mir_a2t(GetContactProto(hContact));
rvaVarsToReplace[3].lptzKey = NULL;
rvaVarsToReplace[3].lptzValue = NULL;
for (int i=0; i < (SIZEOF(rvaVarsToReplace)-1);i++)
@@ -274,7 +274,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
tmi.printTimeStamp(NULL, dbei.timestamp, _T("t d"), datetimestr, SIZEOF(datetimestr), 0);
SetDlgItemText(hwndDlg, IDC_DATE, datetimestr);
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char* szProto = GetContactProto(dat->hContact);
if (szProto) {
int hasName = 0;
char buf[128];
@@ -322,15 +322,12 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
- { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
+ {
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto;
-
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto) {
- HICON hIcon;
-
- hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
DestroyIcon(hIcon);
diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp
index 642e2fd950..5c1419c683 100644
--- a/src/core/stdfile/filesenddlg.cpp
+++ b/src/core/stdfile/filesenddlg.cpp
@@ -231,7 +231,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_TO, contactName);
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto) {
CONTACTINFO ci;
int hasName = 0;
@@ -276,9 +276,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto;
-
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto) {
HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
diff --git a/src/core/stdfile/filexferdlg.cpp b/src/core/stdfile/filexferdlg.cpp
index 306c0cd457..474c49f7df 100644
--- a/src/core/stdfile/filexferdlg.cpp
+++ b/src/core/stdfile/filexferdlg.cpp
@@ -78,7 +78,7 @@ static void SetOpenFileButtonStyle(HWND hwndButton, int enabled)
void FillSendData(FileDlgData* dat, DBEVENTINFO& dbei)
{
dbei.cbSize = sizeof(dbei);
- dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ dbei.szModule = GetContactProto(dat->hContact);
dbei.eventType = EVENTTYPE_FILE;
dbei.flags = DBEF_SENT;
dbei.timestamp = time(NULL);
@@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
dat->hIcon = NULL;
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BM_SETIMAGE, IMAGE_ICON,
- (LPARAM)LoadSkinnedProtoIcon((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0), ID_STATUS_ONLINE));
+ (LPARAM)LoadSkinnedProtoIcon(GetContactProto(dat->hContact), ID_STATUS_ONLINE));
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Contact menu"), 0);
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BUTTONSETASFLATBTN, TRUE, 0);
@@ -469,7 +469,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case M_FILEEXISTSDLGREPLY:
{ PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
TCHAR *szOriginalFilename = (TCHAR*)wParam;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
EnableWindow(hwndDlg, TRUE);
switch(pfr->action) {