diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-09 22:56:44 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-09 22:56:44 +0300 |
commit | 6b1b91acffcc90db9f6d8e0c466d44e2a6819dc3 (patch) | |
tree | c452f4ccd55c4e7d8593935e821f4aa5417496af /utilities.cpp | |
parent | e060779f0f9f76b9ffb4082c20d7c2b3a86c1513 (diff) |
modified: init.cpp
modified: messages.cpp
modified: new_gpg.rc
modified: options.cpp
modified: utilities.cpp
Diffstat (limited to 'utilities.cpp')
-rw-r--r-- | utilities.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/utilities.cpp b/utilities.cpp index c78bc4a..9c07b89 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -409,6 +409,14 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU f<<tmp; mir_free(tmp); f.close(); + if(_waccess(path_out.c_str(), 0) == -1) + { + if(errno == ENOENT) + { + debuglog<<"info: Failed to write prescense in file\n"; + return FALSE; + } + } { extern TCHAR *password; string out; @@ -487,8 +495,13 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU tmp[size]= '\0'; data.append(tmp); delete [] tmp; + DeleteFile(path_out.c_str()); + } + if(data.empty()) + { + debuglog<<"info: Failed to read prescense sign from file\n"; + return FALSE; } - DeleteFile(path_out.c_str()); if(data.find(_T("-----BEGIN PGP MESSAGE-----")) != wstring::npos && data.find(_T("-----END PGP MESSAGE-----")) != wstring::npos) { wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + _tcslen(_T("-----BEGIN PGP MESSAGE-----")); @@ -504,6 +517,18 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU else p1 += 2; } + if(data.find(_T("Comment: "), p1) != wstring::npos) + { + p1 = data.find(_T("Comment: "), p1); + p1 = data.find(_T("\n"), p1); + if(data.find(_T("Comment: "), p1) != wstring::npos) + { + p1 = data.find(_T("Comment: "), p1); + p1 = data.find(_T("\n"), p1)+2; + } + else + p1 += 2; + } else p1+=2; wstring::size_type p2 = data.find(_T("-----END PGP MESSAGE-----")); |