From 6625610170411e9a5fcd43dfd66436fa12fd43e7 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 16 Aug 2010 20:11:51 +0300 Subject: modified: constants.h modified: gpg_wrapper.cpp modified: init.cpp modified: main.cpp modified: messages.cpp modified: options.cpp modified: utilities.cpp --- utilities.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index f909121..9270a21 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -104,7 +104,7 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx pfilter[_tcslen(pfilter)+1] = '\0'; pfilter[_tcslen(pfilter)+2] = '\0'; ofn.lpstrFilter=filter; - tmp = UniGetContactSettingUtf(0, szModuleName, szSetting, _T("")); + tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, _T("")); _tcscpy(str, tmp); mir_free(tmp); if(_tcslen(str)< 2) @@ -114,7 +114,7 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx ofn.nMaxFileTitle=MAX_PATH; if(!GetOpenFileName(&ofn)) return; - DBWriteContactSettingTString(0, szModuleName, szSetting, str); + DBWriteContactSettingTString(0, szGPGModuleName, szSetting, str); } TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file) @@ -167,7 +167,7 @@ void GetFolderPath(TCHAR *WindowTittle, char *szSetting) TCHAR path[MAX_PATH]; if (SHGetPathFromIDList(pidl, path)) { - DBWriteContactSettingTString(NULL, szModuleName, "szHomePath", path); + DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", path); } IMalloc * imalloc = 0; if (SUCCEEDED(SHGetMalloc(&imalloc))) @@ -192,14 +192,14 @@ int LoadKey(WPARAM w, LPARAM l) int SendKey(WPARAM w, LPARAM l) { HANDLE hContact = (HANDLE)w; - char *szMessage = UniGetContactSettingUtf(NULL, szModuleName, "GPGPubKey", ""); + char *szMessage = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); if(strlen(szMessage) > 1) { - BYTE enc = DBGetContactSettingByte(hContact, szModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szModuleName, "GPGEncryption", 0); + BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)szMessage); HistoryLog(hContact, "Public key sent", EVENTTYPE_MESSAGE, DBEF_SENT); - DBWriteContactSettingByte(hContact, szModuleName, "GPGEncryption", enc); + DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); } mir_free(szMessage); return 0; @@ -210,8 +210,8 @@ extern HANDLE hLoadPublicKey, hToggleEncryption; int ToggleEncryption(WPARAM w, LPARAM l) { HANDLE hContact = (HANDLE)w; - BYTE enc = DBGetContactSettingByte(hContact, szModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szModuleName, "GPGEncryption", enc?0:1); + BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc?0:1); enc = enc?0:1; CLISTMENUITEM mi = {0}; mi.cbSize=sizeof(mi); @@ -227,7 +227,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) CLISTMENUITEM mi = {0}; mi.cbSize=sizeof(mi); mi.flags = CMIM_NAME; - mi.pszName = DBGetContactSettingByte(hContact, szModuleName, "GPGEncryption", 0)?"Turn off GPG encryption":"Turn on GPG encryption"; + mi.pszName = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)?"Turn off GPG encryption":"Turn on GPG encryption"; CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggleEncryption, (LPARAM)&mi); return 0; } @@ -272,7 +272,7 @@ void HistoryLog(HANDLE hContact, char *data, int event_type, int flags) char szText[MAX_PATH]; DBEVENTINFO Event = {0}; Event.cbSize = sizeof(Event); - Event.szModule = szModuleName; + Event.szModule = szGPGModuleName; Event.eventType = event_type; Event.flags = flags, DBEF_UTF; Event.timestamp = (DWORD)time(NULL); @@ -311,8 +311,7 @@ int GetJabberInterface(WPARAM w, LPARAM l) //get interface for all jabber accoun (*p)->setAccountNumber(0); for(int i = 0; i < count; i++) //get only jabber accounts from all accounts { - char *tmp = mir_u2a(accounts[i]->tszAccountName); - IJabberInterface *JIftmp = getJabberApi(tmp); + IJabberInterface *JIftmp = getJabberApi(accounts[i]->szModuleName); int a = 0; if(JIftmp) { @@ -324,8 +323,6 @@ int GetJabberInterface(WPARAM w, LPARAM l) //get interface for all jabber accoun p++; Accounts.push_back(new JabberAccount); } - mir_free(tmp); - //should i free JIftmp ? } Accounts.pop_back(); AddHandlers(); @@ -334,6 +331,7 @@ int GetJabberInterface(WPARAM w, LPARAM l) //get interface for all jabber accoun static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pUserData) { + return FALSE; } -- cgit v1.2.3