From a1813a32b6302187814fc4e39107fac68bee7286 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 21 Aug 2010 20:09:12 +0300 Subject: modified: messages.cpp modified: utilities.cpp --- utilities.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index a98ff39..2fbc8fb 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -359,20 +359,22 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU wstring data = str; xi.setText(local_node, _T("This message is encrypted.")); wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + _tcslen(_T("-----BEGIN PGP MESSAGE-----")); - if(data.find(_T("Version: "), p1) != wstring::npos) + while(data.find(_T("Version: "), p1) != wstring::npos) { p1 = data.find(_T("Version: "), p1); p1 = data.find(_T("\n"), p1); - if(data.find(_T("Version: "), p1) != wstring::npos) - { - p1 = data.find(_T("Version: "), p1); - p1 = data.find(_T("\n"), p1)+2; - } - else - p1 += 2; } - else - p1+=2; + while(data.find(_T("Comment: "), p1) != wstring::npos) + { + p1 = data.find(_T("Comment: "), p1); + p1 = data.find(_T("\n"), p1); + } + while(data.find(_T("Encoding: "), p1) != wstring::npos) + { + p1 = data.find(_T("Encoding: "), p1); + p1 = data.find(_T("\n"), p1); + } + p1+=2; wstring::size_type p2 = data.find(_T("-----END PGP MESSAGE-----")); HXML encrypted_data = xi.addChild(node, _T("x"), data.substr(p1, p2-p1).c_str()); xi.addAttr(encrypted_data, _T("xmlns"), _T("jabber:x:encrypted")); -- cgit v1.2.3