From 5d7dc0a0e6021470eac321b7af090f01a7bfe82f Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Thu, 12 Aug 2010 16:02:52 +0300 Subject: modified: main.cpp modified: messages.cpp modified: options.cpp modified: utilities.cpp modified: utilities.h --- messages.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index c4a890d..2b81167 100644 --- a/messages.cpp +++ b/messages.cpp @@ -37,12 +37,18 @@ int RecvMsgSvc(WPARAM w, LPARAM l) if(((s2 = str.find(_T("-----END PGP PUBLIC KEY BLOCK-----"))) != wstring::npos) && ((s1 = str.find(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----"))) != wstring::npos)) { //this is public key + if(!DBGetContactSettingByte(ccs->hContact, szModuleName, "GPGEncryption", 0)) + ;// } else if(((s2 = str.find(_T("-/ENCRYPTED-"))) != wstring::npos) && ((s1 = str.find(_T("-ENCRYPTED-"))) != wstring::npos)) { //this is generic encrypted data block + if(!DBGetContactSettingByte(ccs->hContact, szModuleName, "GPGEncryption", 0)) + ;// } else if(((s1 = str.find(_T("This message is encrypted."))) != wstring::npos)) { //this is jabber encrypted data + if(!DBGetContactSettingByte(ccs->hContact, szModuleName, "GPGEncryption", 0)) + ;// } char *utf = mir_utf8encodeW(str.c_str()); //for later usage @@ -69,11 +75,55 @@ int SendMsgSvc(WPARAM w, LPARAM l) { //encrypt data here wchar_t *tmp = mir_utf8decodeW(msg); wstring str = tmp; + MessageBox(0, str.c_str(), _T(""), MB_OK); mir_free(tmp); wstring::size_type s1, s2; + { //not xmpp + string out; + DWORD code; + TCHAR cmd[128]; + wstring path; + char *tmp = UniGetContactSettingUtf(ccs->hContact, szModuleName, "KeyFingerprint", ""); + if(strlen(tmp) < 2) + { + mir_free(tmp); + return CallService(MS_PROTO_CHAINSEND, w, l); + } + _tcscpy(cmd, _T("--batch --yes -e -a -r ")); + TCHAR *tmp2 = mir_a2t(tmp); + mir_free(tmp); + _tcscat(cmd, tmp2); + mir_free(tmp2); + _tcscat(cmd, _T("\"")); + tmp2 = UniGetContactSettingUtf(NULL, szModuleName, "szHomePath", _T("")); + path.append(tmp2); + _tcscat(cmd, tmp2); + mir_free(tmp2); + _tcscat(cmd, _T("\\exported_data")); + path.append(_T("\\exported_data")); + _tcscat(cmd, _T("\"")); + { + wfstream f(path.c_str(), std::ios_base::in); + f<lParam); + char *utf = mir_utf8encodeW(str.c_str()); //for later usage + ccs->hContact = utf; + } - char *utf = mir_utf8encodeW(str.c_str()); //for later usage - mir_free(utf); + } return CallService(MS_PROTO_CHAINSEND, w, l); -- cgit v1.2.3