diff options
Diffstat (limited to 'plugins/New_GPG/src')
-rw-r--r-- | plugins/New_GPG/src/init.cpp | 3 | ||||
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 46 |
2 files changed, 24 insertions, 25 deletions
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 7e06f1040c..9cb03cc152 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -27,7 +27,7 @@ HFONT bold_font = NULL; HANDLE hLoadPubKey = NULL, g_hCLIcon = NULL, hExportGpgKeys = NULL, hImportGpgKeys = NULL;
HGENMENU hSendKey = NULL, hToggleEncryption = NULL;
RECT key_from_keyserver_rect = {0}, firstrun_rect = {0}, new_key_rect = {0}, key_gen_rect = {0}, load_key_rect = {0}, import_key_rect = {0}, key_password_rect = {0}, load_existing_key_rect = {0};
-XML_API xi = {0};
+
int hLangpack = 0;
logtofile debuglog;
bool gpg_valid = false, gpg_keyexist = false;
@@ -168,7 +168,6 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) extern "C" int __declspec(dllexport) Load()
{
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- mir_getXI(&xi); //TODO: check if we have access to api
mir_getLP(&pluginInfo);
init_vars();
CreateServiceFunction("/LoadPubKey",LoadKey);
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 711fbadf95..df16fde641 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -706,11 +706,11 @@ int GetJabberInterface(WPARAM w, LPARAM l) //get interface for all jabber accoun static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pUserData) { HXML local_node = node; - for(int n = 0; n <= xi.getChildCount(node); n++) + for(int n = 0; n <= xmlGetChildCount(node); n++) { - LPCTSTR str = xi.getText(local_node); - LPCTSTR nodename = xi.getName(local_node); - LPCTSTR attr = xi.getAttrValue(local_node, _T("to")); + LPCTSTR str = xmlGetText(local_node); + LPCTSTR nodename = xmlGetName(local_node); + LPCTSTR attr = xmlGetAttrValue(local_node, _T("to")); if(attr) { MCONTACT hContact = ji->ContactFromJID(attr); @@ -723,7 +723,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU if(_tcsstr(str, _T("-----BEGIN PGP MESSAGE-----")) && _tcsstr(str, _T("-----END PGP MESSAGE-----"))) { wstring data = str; - xi.setText(local_node, _T("This message is encrypted.")); + xmlSetText(local_node, _T("This message is encrypted.")); wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + mir_tstrlen(_T("-----BEGIN PGP MESSAGE-----")); while(data.find(_T("Version: "), p1) != wstring::npos) { @@ -744,8 +744,8 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU wstring::size_type p2 = data.find(_T("-----END PGP MESSAGE-----")); wstring data2 = data.substr(p1, p2-p1-2); strip_line_term(data2); - HXML encrypted_data = xi.addChild(node, _T("x"), data2.c_str()); - xi.addAttr(encrypted_data, _T("xmlns"), _T("jabber:x:encrypted")); + HXML encrypted_data = xmlAddChild(node, _T("x"), data2.c_str()); + xmlAddAttr(encrypted_data, _T("xmlns"), _T("jabber:x:encrypted")); return FALSE; } } @@ -892,15 +892,15 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU { std::wstring tmp = data.substr(p1, p2-p1); strip_line_term(tmp); - HXML encrypted_data = xi.addChild(node, _T("x"), tmp.c_str()); - xi.addAttr(encrypted_data, _T("xmlns"), _T("jabber:x:signed")); + HXML encrypted_data = xmlAddChild(node, _T("x"), tmp.c_str()); + xmlAddAttr(encrypted_data, _T("xmlns"), _T("jabber:x:signed")); } } return FALSE; } } } - local_node = xi.getChild(node, n); + local_node = xmlGetChild(node, n); } return FALSE; } @@ -910,35 +910,35 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, void *pUserData) { HXML local_node = node; - for(int n = 0; n <= xi.getChildCount(node); n++) + for(int n = 0; n <= xmlGetChildCount(node); n++) { - LPCTSTR str = xi.getText(local_node); - LPCTSTR nodename = xi.getName(local_node); + LPCTSTR str = xmlGetText(local_node); + LPCTSTR nodename = xmlGetName(local_node); if(nodename) { if(_tcsstr(nodename, _T("x"))) { - for(int n = 0; n < xi.getAttrCount(local_node); n++) + for(int n = 0; n < xmlGetAttrCount(local_node); n++) { - LPCTSTR name = xi.getAttrName(local_node, n); - LPCTSTR value = xi.getAttrValue(local_node, name); + LPCTSTR name = xmlGetAttrName(local_node, n); + LPCTSTR value = xmlGetAttrValue(local_node, name); if(_tcsstr(value, _T("jabber:x:signed"))) { std::wstring status_str; HXML local_node2 = node; - for(int n = 0; n <= xi.getChildCount(node); n++) + for(int n = 0; n <= xmlGetChildCount(node); n++) { - LPCTSTR nodename2 = xi.getName(local_node2); + LPCTSTR nodename2 = xmlGetName(local_node2); if(_tcsstr(nodename2, _T("status"))) { - LPCTSTR status = xi.getText(local_node2); + LPCTSTR status = xmlGetText(local_node2); if(status) status_str = status; break; } - local_node2 = xi.getChild(node, n); + local_node2 = xmlGetChild(node, n); } - LPCTSTR data = xi.getText(local_node); + LPCTSTR data = xmlGetText(local_node); wstring sign = _T("-----BEGIN PGP SIGNATURE-----\n\n"); wstring file = toUTF16(get_random(10)), status_file = toUTF16(get_random(10)); sign += data; @@ -1010,7 +1010,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi { if(!(*p)) break; - hContact = (*p)->getJabberInterface()->ContactFromJID(xi.getAttrValue(node, _T("from"))); + hContact = (*p)->getJabberInterface()->ContactFromJID(xmlGetAttrValue(node, _T("from"))); if(hContact) hcontact_data[hContact].key_in_prescense = out.substr(p1, p2-p1-1).c_str(); } @@ -1023,7 +1023,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi } } } - local_node = xi.getChild(node, n); + local_node = xmlGetChild(node, n); } return FALSE; } |