diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/SecureIM | |
parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (diff) |
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts
git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SecureIM')
-rw-r--r-- | plugins/SecureIM/src/commonheaders.cpp | 6 | ||||
-rw-r--r-- | plugins/SecureIM/src/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt.h | 98 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_check.cpp | 28 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_dll.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_icons.cpp | 10 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_lists.cpp | 20 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_metacontacts.cpp | 18 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_misc.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_popups.cpp | 18 | ||||
-rw-r--r-- | plugins/SecureIM/src/dbevent.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/dbevent.h | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/options.cpp | 8 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_clist.cpp | 15 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_menu.cpp | 58 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_proto.cpp | 4 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_srmm.cpp | 2 |
17 files changed, 148 insertions, 147 deletions
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index de3173403e..6dccfe53bc 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -5,7 +5,7 @@ HINSTANCE g_hInst, g_hIconInst; char TEMP[MAX_PATH];
int TEMP_SIZE = 0;
-HANDLE g_hEvent[2], g_hCLIcon=0, g_hFolders=0;
+HANDLE g_hEvent[2], g_hCLIcon, g_hFolders = 0;
HGENMENU g_hMenu[15];
int iService=0;
@@ -37,7 +37,7 @@ PLUGININFOEX pluginInfoEx = { {0x1B2A39E5, 0xE2F6, 0x494D, {0x95, 0x8D, 0x18, 0x08, 0xFD, 0x11, 0x0D, 0xD5}}
};
-LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSetting)
+LPSTR myDBGetStringDecode(HCONTACT hContact,const char *szModule,const char *szSetting)
{
char *val = db_get_sa(hContact,szModule,szSetting);
if (!val) return NULL;
@@ -47,7 +47,7 @@ LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSet return buf;
}
-int myDBWriteStringEncode(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
+int myDBWriteStringEncode(HCONTACT hContact,const char *szModule,const char *szSetting,const char *val)
{
int len = (int)strlen(val)+64;
char *buf = (LPSTR)alloca(len);
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index 9396b9426d..69305e6d4d 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -102,7 +102,7 @@ int onModulesLoaded(WPARAM, LPARAM); int onShutdown(WPARAM, LPARAM);
int ModuleLoad(WPARAM wParam, LPARAM lParam);
-__forceinline int SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
+__forceinline int SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
return ProtoBroadcastAck( GetContactProto(hContact), hContact, type, result, hProcess, lParam);
}
diff --git a/plugins/SecureIM/src/crypt.h b/plugins/SecureIM/src/crypt.h index a2ec230e48..9da46e8be9 100644 --- a/plugins/SecureIM/src/crypt.h +++ b/plugins/SecureIM/src/crypt.h @@ -39,7 +39,7 @@ typedef partitionMessage* pPM; // memory struct for keys
struct UinKey
{
- HANDLE hContact; // handle of contact
+ HCONTACT hContact; // handle of contact
u_int header; // HEADER
pSupPro proto; // proto struct
BYTE mode,tmode; // mode: Native,PGP,GPG,RSA/AES,RSA [0..4]
@@ -70,13 +70,13 @@ typedef UinKey* pUinKey; struct TFakeAckParams
{
- __forceinline TFakeAckParams(HANDLE p1, LONG p2, LPCSTR p3) :
+ __forceinline TFakeAckParams(HCONTACT p1, LONG p2, LPCSTR p3) :
hContact(p1),
id(p2),
msg(p3)
{}
- HANDLE hContact;
+ HCONTACT hContact;
LONG id;
LPCSTR msg;
};
@@ -90,73 +90,73 @@ extern LIST<UinKey> arClist; // crypt_lists.cpp
void loadContactList();
void freeContactList();
-pUinKey addContact(HANDLE hContact);
-void delContact(HANDLE hContact);
-pSupPro getSupPro(HANDLE);
-pUinKey findUinKey(HANDLE hContact);
-pUinKey getUinKey(HANDLE hContact);
+pUinKey addContact(HCONTACT hContact);
+void delContact(HCONTACT hContact);
+pSupPro getSupPro(HCONTACT);
+pUinKey findUinKey(HCONTACT hContact);
+pUinKey getUinKey(HCONTACT hContact);
pUinKey getUinCtx(HANDLE);
void addMsg2Queue(pUinKey,WPARAM,LPSTR);
-void getContactName(HANDLE hContact, LPSTR szName);
-void getContactNameA(HANDLE hContact, LPSTR szName);
-void getContactUin(HANDLE hContact, LPSTR szUIN);
-void getContactUinA(HANDLE hContact, LPSTR szUIN);
+void getContactName(HCONTACT hContact, LPSTR szName);
+void getContactNameA(HCONTACT hContact, LPSTR szName);
+void getContactUin(HCONTACT hContact, LPSTR szUIN);
+void getContactUinA(HCONTACT hContact, LPSTR szUIN);
// crypt_check.cpp
-int getContactStatus(HANDLE);
+int getContactStatus(HCONTACT);
-bool isSecureProtocol(HANDLE hContact);
-BYTE isContactSecured(HANDLE hContact);
+bool isSecureProtocol(HCONTACT hContact);
+BYTE isContactSecured(HCONTACT hContact);
bool isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda=FALSE);
-bool isClientMiranda(HANDLE hContact, BOOL emptyMirverAsMiranda=FALSE);
-bool isProtoSmallPackets(HANDLE);
-bool isContactInvisible(HANDLE);
-bool isNotOnList(HANDLE);
-bool isContactNewPG(HANDLE);
-bool isContactPGP(HANDLE);
-bool isContactGPG(HANDLE);
-bool isContactRSAAES(HANDLE);
-bool isContactRSA(HANDLE);
-bool isChatRoom(HANDLE);
+bool isClientMiranda(HCONTACT hContact, BOOL emptyMirverAsMiranda=FALSE);
+bool isProtoSmallPackets(HCONTACT);
+bool isContactInvisible(HCONTACT);
+bool isNotOnList(HCONTACT);
+bool isContactNewPG(HCONTACT);
+bool isContactPGP(HCONTACT);
+bool isContactGPG(HCONTACT);
+bool isContactRSAAES(HCONTACT);
+bool isContactRSA(HCONTACT);
+bool isChatRoom(HCONTACT);
bool isFileExist(LPCSTR);
bool isSecureIM(pUinKey ptr, BOOL emptyMirverAsSecureIM=FALSE);
-bool isSecureIM(HANDLE hContact, BOOL emptyMirverAsSecureIM=FALSE);
+bool isSecureIM(HCONTACT hContact, BOOL emptyMirverAsSecureIM=FALSE);
// crypt_icons.cpp
HICON mode2icon(int,int);
HANDLE mode2clicon(int mode, int type);
void RefreshContactListIcons(void);
-void ShowStatusIcon(HANDLE,UINT);
-void ShowStatusIcon(HANDLE);
-void ShowStatusIconNotify(HANDLE);
+void ShowStatusIcon(HCONTACT, UINT);
+void ShowStatusIcon(HCONTACT);
+void ShowStatusIconNotify(HCONTACT);
// crypt_popups.cpp
//static int CALLBACK PopupDlgProc(HWND,UINT,WPARAM,LPARAM);
-void showPopup(LPCSTR,HANDLE,HICON,UINT);
-void showPopupEC(HANDLE);
-void showPopupDCmsg(HANDLE,LPCSTR);
-void showPopupDC(HANDLE);
-void showPopupKS(HANDLE);
-void showPopupKRmsg(HANDLE,LPCSTR);
-void showPopupKR(HANDLE);
-void showPopupSM(HANDLE);
-void showPopupRM(HANDLE);
+void showPopup(LPCSTR, HCONTACT, HICON, UINT);
+void showPopupEC(HCONTACT);
+void showPopupDCmsg(HCONTACT, LPCSTR);
+void showPopupDC(HCONTACT);
+void showPopupKS(HCONTACT);
+void showPopupKRmsg(HCONTACT, LPCSTR);
+void showPopupKR(HCONTACT);
+void showPopupSM(HCONTACT);
+void showPopupRM(HCONTACT);
// crypt_meta.cpp
-BOOL isProtoMetaContacts(HANDLE);
-BOOL isDefaultSubContact(HANDLE);
-HANDLE getMetaContact(HANDLE);
-HANDLE getMostOnline(HANDLE);
-void DeinitMetaContact(HANDLE);
+BOOL isProtoMetaContacts(HCONTACT);
+BOOL isDefaultSubContact(HCONTACT);
+HCONTACT getMetaContact(HCONTACT);
+HCONTACT getMostOnline(HCONTACT);
+void DeinitMetaContact(HCONTACT);
// crypt_dll.cpp
-LPSTR InitKeyA(pUinKey,int);
-int InitKeyB(pUinKey,LPCSTR);
-void InitKeyX(pUinKey,BYTE*);
-BOOL CalculateKeyX(pUinKey,HANDLE);
-LPSTR encodeMsg(pUinKey,LPARAM);
-LPSTR decodeMsg(pUinKey,LPARAM,LPSTR);
+LPSTR InitKeyA(pUinKey, int);
+int InitKeyB(pUinKey, LPCSTR);
+void InitKeyX(pUinKey, BYTE*);
+BOOL CalculateKeyX(pUinKey, HCONTACT);
+LPSTR encodeMsg(pUinKey, LPARAM);
+LPSTR decodeMsg(pUinKey, LPARAM, LPSTR);
BOOL LoadKeyPGP(pUinKey);
BOOL LoadKeyGPG(pUinKey);
diff --git a/plugins/SecureIM/src/crypt_check.cpp b/plugins/SecureIM/src/crypt_check.cpp index 9369a1ba64..44c6c8183a 100644 --- a/plugins/SecureIM/src/crypt_check.cpp +++ b/plugins/SecureIM/src/crypt_check.cpp @@ -1,6 +1,6 @@ #include "commonheaders.h"
-int getContactStatus(HANDLE hContact)
+int getContactStatus(HCONTACT hContact)
{
pSupPro ptr = getSupPro(hContact);
if (ptr)
@@ -9,7 +9,7 @@ int getContactStatus(HANDLE hContact) return -1;
}
-bool isSecureProtocol(HANDLE hContact)
+bool isSecureProtocol(HCONTACT hContact)
{
pSupPro ptr = getSupPro(hContact);
if (!ptr)
@@ -18,7 +18,7 @@ bool isSecureProtocol(HANDLE hContact) return ptr->inspecting != 0;
}
-BYTE isContactSecured(HANDLE hContact)
+BYTE isContactSecured(HCONTACT hContact)
{
// нужна проверка на Offline и в этом случае другие статусы
if (!arClist.getCount()) return 0;
@@ -76,7 +76,7 @@ bool isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda) return isMiranda;
}
-bool isClientMiranda(HANDLE hContact, BOOL emptyMirverAsMiranda)
+bool isClientMiranda(HCONTACT hContact, BOOL emptyMirverAsMiranda)
{
if (!bMCD) return true;
if (!arClist.getCount()) return false;
@@ -85,7 +85,7 @@ bool isClientMiranda(HANDLE hContact, BOOL emptyMirverAsMiranda) return (p) ? isClientMiranda(p, emptyMirverAsMiranda) : false;
}
-bool isProtoSmallPackets(HANDLE hContact)
+bool isProtoSmallPackets(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -94,7 +94,7 @@ bool isProtoSmallPackets(HANDLE hContact) return strstr(p->proto->name,"IRC") != NULL || strstr(p->proto->name,"WinPopup") != NULL || strstr(p->proto->name,"VyChat") != NULL;
}
-bool isContactInvisible(HANDLE hContact)
+bool isContactInvisible(HCONTACT hContact)
{
if (db_get_b(hContact, "CList", "Hidden", 0))
return true;
@@ -114,12 +114,12 @@ bool isContactInvisible(HANDLE hContact) return false;
}
-bool isNotOnList(HANDLE hContact)
+bool isNotOnList(HCONTACT hContact)
{
return db_get_b(hContact, "CList", "NotOnList", 0) != 0;
}
-bool isContactNewPG(HANDLE hContact)
+bool isContactNewPG(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting || !p->cntx)
@@ -128,7 +128,7 @@ bool isContactNewPG(HANDLE hContact) return (p->features & CPP_FEATURES_NEWPG) != 0;
}
-bool isContactPGP(HANDLE hContact)
+bool isContactPGP(HCONTACT hContact)
{
if (!bPGPloaded || (!bPGPkeyrings && !bPGPprivkey)) return false;
@@ -142,7 +142,7 @@ bool isContactPGP(HANDLE hContact) return true;
}
-bool isContactGPG(HANDLE hContact)
+bool isContactGPG(HCONTACT hContact)
{
if (!bGPGloaded || !bGPGkeyrings) return false;
@@ -156,7 +156,7 @@ bool isContactGPG(HANDLE hContact) return true;
}
-bool isContactRSAAES(HANDLE hContact)
+bool isContactRSAAES(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -165,7 +165,7 @@ bool isContactRSAAES(HANDLE hContact) return p->mode == MODE_RSAAES;
}
-bool isContactRSA(HANDLE hContact)
+bool isContactRSA(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -174,7 +174,7 @@ bool isContactRSA(HANDLE hContact) return p->mode == MODE_RSA;
}
-bool isChatRoom(HANDLE hContact)
+bool isChatRoom(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -205,7 +205,7 @@ bool isSecureIM(pUinKey ptr, BOOL emptyMirverAsSecureIM) return isSecureIM;
}
-bool isSecureIM(HANDLE hContact, BOOL emptyMirverAsSecureIM)
+bool isSecureIM(HCONTACT hContact, BOOL emptyMirverAsSecureIM)
{
if (!bAIP) return false;
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp index f9b5325e2f..59c5698384 100644 --- a/plugins/SecureIM/src/crypt_dll.cpp +++ b/plugins/SecureIM/src/crypt_dll.cpp @@ -73,7 +73,7 @@ void InitKeyX(pUinKey ptr,BYTE *key) // calculate secret key
-BOOL CalculateKeyX(pUinKey ptr,HANDLE hContact)
+BOOL CalculateKeyX(pUinKey ptr,HCONTACT hContact)
{
int agr = cpp_calc_keyx(ptr->cntx);
if (agr) {
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index ab421e843b..dfb0d0771d 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -62,9 +62,9 @@ HANDLE mode2clicon(int mode, int type) }
// обновляет иконки в clist и в messagew
-void ShowStatusIcon(HANDLE hContact, int mode)
+void ShowStatusIcon(HCONTACT hContact, int mode)
{
- HANDLE hMC = getMetaContact(hContact);
+ HCONTACT hMC = getMetaContact(hContact);
// обновить иконки в clist
if (mode != -1) {
@@ -92,12 +92,12 @@ void ShowStatusIcon(HANDLE hContact, int mode) }
}
-void ShowStatusIcon(HANDLE hContact)
+void ShowStatusIcon(HCONTACT hContact)
{
ShowStatusIcon(hContact, isContactSecured(hContact));
}
-void ShowStatusIconNotify(HANDLE hContact)
+void ShowStatusIconNotify(HCONTACT hContact)
{
BYTE mode = isContactSecured(hContact);
NotifyEventHooks(g_hEvent[(mode&SECURED) != 0], (WPARAM)hContact, 0);
@@ -109,7 +109,7 @@ void RefreshContactListIcons(void) for (int i=0; i < arIcoList.getCount(); i++)
arIcoList[i].hCLIcon = 0;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if (isSecureProtocol(hContact))
ShowStatusIcon(hContact);
}
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 2e229a1ccf..9ec49d9705 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -62,7 +62,7 @@ void freeSupportedProtocols() arProto.destroy();
}
-pSupPro getSupPro(HANDLE hContact)
+pSupPro getSupPro(HCONTACT hContact)
{
for (int j=0; j < arProto.getCount(); j++)
if (CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)arProto[j]->name))
@@ -72,7 +72,7 @@ pSupPro getSupPro(HANDLE hContact) }
// add contact in the list of secureIM users
-pUinKey addContact(HANDLE hContact)
+pUinKey addContact(HCONTACT hContact)
{
if (hContact == NULL) return NULL;
@@ -99,7 +99,7 @@ pUinKey addContact(HANDLE hContact) }
// delete contact from the list of secureIM users
-void delContact(HANDLE hContact)
+void delContact(HCONTACT hContact)
{
pUinKey p = arClist.find((pUinKey)&hContact);
if (p) {
@@ -118,7 +118,7 @@ void loadContactList() freeContactList();
loadSupportedProtocols();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
addContact(hContact);
}
@@ -138,12 +138,12 @@ void freeContactList() }
// find user in the list of secureIM users and add him, if unknow
-pUinKey findUinKey(HANDLE hContact)
+pUinKey findUinKey(HCONTACT hContact)
{
return arClist.find((pUinKey)&hContact);
}
-pUinKey getUinKey(HANDLE hContact)
+pUinKey getUinKey(HCONTACT hContact)
{
pUinKey p = arClist.find((pUinKey)&hContact);
return (p) ? p : addContact(hContact);
@@ -198,16 +198,16 @@ void addMsg2Queue(pUinKey ptr,WPARAM wParam,LPSTR szMsg) LeaveCriticalSection(&localQueueMutex);
}
-void getContactNameA(HANDLE hContact, LPSTR szName) {
+void getContactNameA(HCONTACT hContact, LPSTR szName) {
strcpy(szName,(LPCSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0));
}
-void getContactName(HANDLE hContact, LPSTR szName)
+void getContactName(HCONTACT hContact, LPSTR szName)
{
wcscpy((LPWSTR)szName, (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GSMDF_UNICODE));
}
-void getContactUinA(HANDLE hContact, LPSTR szUIN)
+void getContactUinA(HCONTACT hContact, LPSTR szUIN)
{
*szUIN = 0;
@@ -233,7 +233,7 @@ void getContactUinA(HANDLE hContact, LPSTR szUIN) db_free(&dbv_uniqueid);
}
-void getContactUin(HANDLE hContact, LPSTR szUIN)
+void getContactUin(HCONTACT hContact, LPSTR szUIN)
{
getContactUinA(hContact, szUIN);
if (*szUIN) {
diff --git a/plugins/SecureIM/src/crypt_metacontacts.cpp b/plugins/SecureIM/src/crypt_metacontacts.cpp index 39bebd23c2..50bd21767e 100644 --- a/plugins/SecureIM/src/crypt_metacontacts.cpp +++ b/plugins/SecureIM/src/crypt_metacontacts.cpp @@ -1,6 +1,6 @@ #include "commonheaders.h"
-BOOL isProtoMetaContacts(HANDLE hContact)
+BOOL isProtoMetaContacts(HCONTACT hContact)
{
if (bMetaContacts) {
LPSTR proto = GetContactProto(hContact);
@@ -10,7 +10,7 @@ BOOL isProtoMetaContacts(HANDLE hContact) return false;
}
-BOOL isDefaultSubContact(HANDLE hContact)
+BOOL isDefaultSubContact(HCONTACT hContact)
{
if (bMetaContacts)
return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0) == hContact;
@@ -18,29 +18,29 @@ BOOL isDefaultSubContact(HANDLE hContact) return false;
}
-HANDLE getMetaContact(HANDLE hContact)
+HCONTACT getMetaContact(HCONTACT hContact)
{
if (bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ return (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
return 0;
}
-HANDLE getMostOnline(HANDLE hContact)
+HCONTACT getMostOnline(HCONTACT hContact)
{
if (bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ return (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
return 0;
}
// remove all secureim connections on subcontacts
-void DeinitMetaContact(HANDLE hContact)
+void DeinitMetaContact(HCONTACT hContact)
{
- HANDLE hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact);
+ HCONTACT hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact);
if (hMetaContact) {
for (int i=0; i < CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hMetaContact,0); i++) {
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i);
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i);
if (hSubContact && (isContactSecured(hSubContact)&SECURED))
CallContactService(hSubContact,PSS_MESSAGE, PREF_METANODB, (LPARAM)SIG_DEIN);
}
diff --git a/plugins/SecureIM/src/crypt_misc.cpp b/plugins/SecureIM/src/crypt_misc.cpp index aa0025038c..6e34f77aee 100644 --- a/plugins/SecureIM/src/crypt_misc.cpp +++ b/plugins/SecureIM/src/crypt_misc.cpp @@ -2,7 +2,7 @@ static void sttWaitForExchange(LPVOID param)
{
- HANDLE hContact = (HANDLE)param;
+ HCONTACT hContact = (HCONTACT)param;
pUinKey ptr = getUinKey(hContact);
if (!ptr)
return;
diff --git a/plugins/SecureIM/src/crypt_popups.cpp b/plugins/SecureIM/src/crypt_popups.cpp index b584f5902d..9b085bdb3e 100644 --- a/plugins/SecureIM/src/crypt_popups.cpp +++ b/plugins/SecureIM/src/crypt_popups.cpp @@ -1,6 +1,6 @@ #include "commonheaders.h"
-void showPopup(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type)
+void showPopup(LPCSTR lpzText,HCONTACT hContact,HICON hIcon, UINT type)
{
//type=0 key colors
//type=1 session colors
@@ -52,50 +52,50 @@ void showPopup(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type) PUAddPopupW(&ppd);
}
-void showPopupDCmsg(HANDLE hContact,LPCSTR msg)
+void showPopupDCmsg(HCONTACT hContact,LPCSTR msg)
{
if (db_get_b(0, MODULENAME, "dc", 1))
showPopup(msg, hContact, g_hPOP[POP_PU_DIS], 1);
}
-void showPopupDC(HANDLE hContact)
+void showPopupDC(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "dc", 1))
showPopup(sim006, hContact, g_hPOP[POP_PU_DIS], 1);
}
-void showPopupEC(HANDLE hContact)
+void showPopupEC(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "ec", 1))
showPopup(sim001, hContact, g_hPOP[POP_PU_EST], 1);
}
-void showPopupKS(HANDLE hContact)
+void showPopupKS(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "ks",1))
showPopup(sim007, hContact, g_hPOP[POP_PU_PRC], 0);
}
-void showPopupKRmsg(HANDLE hContact,LPCSTR msg)
+void showPopupKRmsg(HCONTACT hContact,LPCSTR msg)
{
if (db_get_b(0, MODULENAME, "kr", 1))
showPopup(msg, hContact, g_hPOP[POP_PU_PRC], 0);
}
-void showPopupKR(HANDLE hContact)
+void showPopupKR(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "kr", 1))
showPopup(sim008, hContact, g_hPOP[POP_PU_PRC], 0);
}
-void showPopupSM(HANDLE hContact)
+void showPopupSM(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "ss", 0))
showPopup(sim009, hContact, g_hPOP[POP_PU_MSS], 2);
SkinPlaySound("OutgoingSecureMessage");
}
-void showPopupRM(HANDLE hContact)
+void showPopupRM(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "sr", 0))
showPopup(sim010, hContact, g_hPOP[POP_PU_MSR], 2);
diff --git a/plugins/SecureIM/src/dbevent.cpp b/plugins/SecureIM/src/dbevent.cpp index 6e43318dad..7d3d0afaf7 100644 --- a/plugins/SecureIM/src/dbevent.cpp +++ b/plugins/SecureIM/src/dbevent.cpp @@ -1,7 +1,7 @@ #include "commonheaders.h"
-void HistoryLog(HANDLE hContact, LPCSTR szText)
+void HistoryLog(HCONTACT hContact, LPCSTR szText)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = GetContactProto(hContact);
diff --git a/plugins/SecureIM/src/dbevent.h b/plugins/SecureIM/src/dbevent.h index c46ead73a1..4eb5251eb1 100644 --- a/plugins/SecureIM/src/dbevent.h +++ b/plugins/SecureIM/src/dbevent.h @@ -1,6 +1,6 @@ #ifndef __DBEVENT_H__
#define __DBEVENT_H__
-void HistoryLog(HANDLE,LPCSTR);
+void HistoryLog(HCONTACT, LPCSTR);
#endif
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 432d0ccb4d..31d5159a9b 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -977,7 +977,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) char tmp[NAMSIZE];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && isSecureProtocol(hContact) && !isChatRoom(hContact)) {
if (iInit) {
@@ -1063,7 +1063,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) char tmp[NAMSIZE];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_PGP && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
LPSTR szKeyID = db_get_sa(hContact,MODULENAME,"pgp_abbr");
@@ -1123,7 +1123,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) char tmp[NAMSIZE];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_GPG && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
if (iInit )
@@ -1176,7 +1176,7 @@ void ResetGeneralDlg(HWND hDlg) lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
char tmp[NAMSIZE];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (!isSecureProtocol(hContact) || isChatRoom(hContact))
continue;
diff --git a/plugins/SecureIM/src/svcs_clist.cpp b/plugins/SecureIM/src/svcs_clist.cpp index b2af53bb19..24efb7785b 100644 --- a/plugins/SecureIM/src/svcs_clist.cpp +++ b/plugins/SecureIM/src/svcs_clist.cpp @@ -3,7 +3,7 @@ int __cdecl onContactSettingChanged(WPARAM wParam,LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
if (!hContact || strcmp(cws->szSetting,"Status")) return 0;
@@ -35,8 +35,9 @@ int __cdecl onContactSettingChanged(WPARAM wParam,LPARAM lParam) { // wParam=(WPARAM)(HANDLE)hContact
// lParam=0
-int __cdecl onContactAdded(WPARAM wParam,LPARAM lParam) {
- addContact((HANDLE)wParam);
+int __cdecl onContactAdded(WPARAM wParam,LPARAM lParam)
+{
+ addContact((HCONTACT)wParam);
return 0;
}
@@ -45,7 +46,7 @@ int __cdecl onContactAdded(WPARAM wParam,LPARAM lParam) { // lParam=0
int __cdecl onContactDeleted(WPARAM wParam,LPARAM lParam)
{
- delContact((HANDLE)wParam);
+ delContact((HCONTACT)wParam);
return 0;
}
@@ -58,15 +59,15 @@ int __cdecl onExtraImageListRebuilding(WPARAM, LPARAM) int __cdecl onExtraImageApplying(WPARAM wParam, LPARAM)
{
- if (isSecureProtocol((HANDLE)wParam))
- ExtraIcon_SetIcon(g_hCLIcon, (HANDLE)wParam, mode2clicon( isContactSecured((HANDLE)wParam), 1));
+ if (isSecureProtocol((HCONTACT)wParam))
+ ExtraIcon_SetIcon(g_hCLIcon, (HCONTACT)wParam, mode2clicon(isContactSecured((HCONTACT)wParam), 1));
return 0;
}
int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
BOOL bMC = isProtoMetaContacts(hContact);
if (bMC ) hContact = getMostOnline(hContact); // возьмем тот, через который пойдет сообщение
pUinKey ptr = getUinKey(hContact);
diff --git a/plugins/SecureIM/src/svcs_menu.cpp b/plugins/SecureIM/src/svcs_menu.cpp index b8fba61f48..f099757b0d 100644 --- a/plugins/SecureIM/src/svcs_menu.cpp +++ b/plugins/SecureIM/src/svcs_menu.cpp @@ -3,19 +3,19 @@ INT_PTR __cdecl Service_IsContactSecured(WPARAM wParam, LPARAM lParam)
{
- return (isContactSecured((HANDLE)wParam)&SECURED) || isContactPGP((HANDLE)wParam) || isContactGPG((HANDLE)wParam);
+ return (isContactSecured((HCONTACT)wParam)&SECURED) || isContactPGP((HCONTACT)wParam) || isContactGPG((HCONTACT)wParam);
}
INT_PTR __cdecl Service_CreateIM(WPARAM wParam,LPARAM lParam)
{
- CallContactService((HANDLE)wParam,PSS_MESSAGE, PREF_METANODB,(LPARAM)SIG_INIT);
+ CallContactService((HCONTACT)wParam, PSS_MESSAGE, PREF_METANODB, (LPARAM)SIG_INIT);
return 1;
}
INT_PTR __cdecl Service_DisableIM(WPARAM wParam,LPARAM lParam)
{
- CallContactService((HANDLE)wParam,PSS_MESSAGE, PREF_METANODB,(LPARAM)SIG_DEIN);
+ CallContactService((HCONTACT)wParam, PSS_MESSAGE, PREF_METANODB, (LPARAM)SIG_DEIN);
return 1;
}
@@ -25,7 +25,7 @@ INT_PTR __cdecl Service_Status(WPARAM wParam, LPARAM lParam) case STATUS_DISABLED:
case STATUS_ENABLED:
case STATUS_ALWAYSTRY:
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
if (ptr) {
ptr->status=ptr->tstatus=(BYTE)lParam;
if (ptr->status == STATUS_ENABLED) db_unset(ptr->hContact, MODULENAME, "StatusID");
@@ -55,15 +55,15 @@ INT_PTR __cdecl Service_StatusTry(WPARAM wParam, LPARAM lParam) INT_PTR __cdecl Service_PGPdelKey(WPARAM wParam, LPARAM lParam)
{
if (bPGPloaded) {
- db_unset((HANDLE)wParam, MODULENAME, "pgp");
- db_unset((HANDLE)wParam, MODULENAME, "pgp_mode");
- db_unset((HANDLE)wParam, MODULENAME, "pgp_abbr");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp_mode");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp_abbr");
}
{
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
@@ -75,10 +75,10 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) char szKeyID[128]; szKeyID[0]='\0';
PVOID KeyID = pgp_select_keyid(GetForegroundWindow(),szKeyID);
if (szKeyID[0]) {
- db_unset((HANDLE)wParam,MODULENAME,"pgp");
- db_set_blob((HANDLE)wParam, MODULENAME, "pgp", KeyID, pgp_size_keyid());
- db_set_b((HANDLE)wParam,MODULENAME,"pgp_mode",0);
- db_set_s((HANDLE)wParam,MODULENAME,"pgp_abbr",szKeyID);
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp");
+ db_set_blob((HCONTACT)wParam, MODULENAME, "pgp", KeyID, pgp_size_keyid());
+ db_set_b((HCONTACT)wParam, MODULENAME, "pgp_mode", 0);
+ db_set_s((HCONTACT)wParam, MODULENAME, "pgp_abbr", szKeyID);
del = false;
}
}
@@ -87,10 +87,10 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) if (ShowSelectKeyDlg(0,KeyPath)) {
char *publ = LoadKeys(KeyPath,false);
if (publ) {
- db_unset((HANDLE)wParam,MODULENAME,"pgp");
- db_set_s((HANDLE)wParam,MODULENAME,"pgp",publ);
- db_set_b((HANDLE)wParam,MODULENAME,"pgp_mode",1);
- db_set_s((HANDLE)wParam,MODULENAME,"pgp_abbr","(binary)");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp");
+ db_set_s((HCONTACT)wParam, MODULENAME, "pgp", publ);
+ db_set_b((HCONTACT)wParam, MODULENAME, "pgp_mode", 1);
+ db_set_s((HCONTACT)wParam, MODULENAME, "pgp_abbr", "(binary)");
mir_free(publ);
del = false;
}
@@ -101,22 +101,22 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) if (del)
Service_PGPdelKey(wParam,lParam);
else {
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
INT_PTR __cdecl Service_GPGdelKey(WPARAM wParam, LPARAM lParam)
{
if (bGPGloaded)
- db_unset((HANDLE)wParam, MODULENAME, "gpg");
+ db_unset((HCONTACT)wParam, MODULENAME, "gpg");
{
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
@@ -127,28 +127,28 @@ INT_PTR __cdecl Service_GPGsetKey(WPARAM wParam, LPARAM lParam) char szKeyID[128]; szKeyID[0]='\0';
gpg_select_keyid(GetForegroundWindow(),szKeyID);
if (szKeyID[0]) {
- db_set_s((HANDLE)wParam,MODULENAME,"gpg",szKeyID);
+ db_set_s((HCONTACT)wParam, MODULENAME, "gpg", szKeyID);
del = false;
}
}
if (del) Service_GPGdelKey(wParam,lParam);
else {
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam)
{
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
switch(--lParam) {
case MODE_NATIVE:
case MODE_RSAAES:
- if (isContactSecured((HANDLE)wParam)&SECURED) {
+ if (isContactSecured((HCONTACT)wParam)&SECURED) {
msgbox(NULL, sim111, MODULENAME, MB_OK);
return 0;
}
@@ -165,9 +165,9 @@ INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam) ptr->keyLoaded = 0;
}
ptr->mode=(BYTE)lParam;
- db_set_b((HANDLE)wParam, MODULENAME, "mode", (BYTE)lParam);
+ db_set_b((HCONTACT)wParam, MODULENAME, "mode", (BYTE)lParam);
}
- ShowStatusIcon((HANDLE)wParam);
+ ShowStatusIcon((HCONTACT)wParam);
break;
}
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index 7350aa9e95..7a0c20fe3c 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -31,13 +31,13 @@ static void sttFakeAck(LPVOID param) delete tParam;
}
-int returnNoError(HANDLE hContact)
+int returnNoError(HCONTACT hContact)
{
mir_forkthread(sttFakeAck, new TFakeAckParams(hContact, 777, 0));
return 777;
}
-int returnError(HANDLE hContact, LPCSTR err)
+int returnError(HCONTACT hContact, LPCSTR err)
{
mir_forkthread(sttFakeAck, new TFakeAckParams(hContact, 666, err));
return 666;
diff --git a/plugins/SecureIM/src/svcs_srmm.cpp b/plugins/SecureIM/src/svcs_srmm.cpp index 6c05f77bca..59791ee43c 100644 --- a/plugins/SecureIM/src/svcs_srmm.cpp +++ b/plugins/SecureIM/src/svcs_srmm.cpp @@ -11,7 +11,7 @@ int __cdecl onWindowEvent(WPARAM, LPARAM lParam) int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (isProtoMetaContacts(hContact))
hContact = getMostOnline(hContact); // возьмем тот, через который пойдет сообщение
|