summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.cpp2
-rw-r--r--main.cpp4
-rw-r--r--main.h8
-rw-r--r--options.cpp2
-rw-r--r--utilities.cpp10
5 files changed, 20 insertions, 6 deletions
diff --git a/init.cpp b/init.cpp
index f71ebe6..29602f6 100644
--- a/init.cpp
+++ b/init.cpp
@@ -32,6 +32,7 @@ MM_INTERFACE mmi = {0};
UTF8_INTERFACE utfi = {0};
XML_API xi = {0};
logtofile debuglog;
+std::map<HANDLE, contact_data> hcontact_data;
#define MIID_GPG { 0x4227c050, 0x8d97, 0x48d2, { 0x91, 0xec, 0x6a, 0x95, 0x2b, 0x3d, 0xab, 0x94 } }
@@ -87,6 +88,7 @@ void init_vars()
outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", _T("<GPGenc>"));
outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", _T("</GPGenc>"));
bDebugLog = DBGetContactSettingByte(NULL, szGPGModuleName, "bDebugLog", 0);
+ bAutoExchange = DBGetContactSettingByte(NULL, szGPGModuleName, "bAutoExchange", 0);
debuglog.init();
bJabberAPI = DBGetContactSettingByte(NULL, szGPGModuleName, "bJabberAPI", bIsMiranda09?1:0);
bFileTransfers = DBGetContactSettingByte(NULL, szGPGModuleName, "bFileTransfers", 1);
diff --git a/main.cpp b/main.cpp
index df6bee9..d2d1984 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1529,14 +1529,14 @@ void InitCheck()
ShowFirstRunDialog();
}
extern bool bAutoExchange;
- if(bAutoExchange && (ServiceExists(PS_ICQ_ADDCAPABILITY)))
+ if(bAutoExchange && (ServiceExists("ICQ"PS_ICQ_ADDCAPABILITY))) //work only for one icq instance
{
ICQ_CUSTOMCAP cap;
cap.cbSize = sizeof(ICQ_CUSTOMCAP);
cap.hIcon = 0;
strcpy(cap.name, "GPG Key AutoExchange");
strcpy(cap.caps, "GPG AutoExchange");
- CallService(PS_ICQ_ADDCAPABILITY, 0, (LPARAM)&cap);
+ CallService("ICQ"PS_ICQ_ADDCAPABILITY, 0, (LPARAM)&cap);
}
}
diff --git a/main.h b/main.h
index d63c3c6..0c59b5d 100644
--- a/main.h
+++ b/main.h
@@ -16,6 +16,14 @@
#ifndef MAIN_H
#define MAIN_H
+struct contact_data
+{
+ vector<string> msgs_to_tag;
+ string key_in_prescense;
+};
+
+extern std::map<HANDLE, contact_data> hcontact_data;
+
#endif
diff --git a/options.cpp b/options.cpp
index 948e5ac..d2a106b 100644
--- a/options.cpp
+++ b/options.cpp
@@ -235,7 +235,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}
}
if(!keep)
- if(MessageBox(0, _T("This key not used by any contact, do you want to remove it from publick keyring ?"), _T("Key info"), MB_YESNO) == IDYES)
+ if(MessageBox(0, _T("This key not used by any contact, do you want to remove it from public keyring ?"), _T("Key info"), MB_YESNO) == IDYES)
{
wstring cmd;
string output;
diff --git a/utilities.cpp b/utilities.cpp
index 4a9fadc..2dc210e 100644
--- a/utilities.cpp
+++ b/utilities.cpp
@@ -778,7 +778,8 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
break;
hContact = (*p)->getJabberInterface()->Sys()->ContactFromJID(xi.getAttrValue(node, _T("from")));
if(hContact)
- DBWriteContactSettingString(hContact, szGPGModuleName, "KeyID_Prescense", out.substr(p1, p2-p1-1).c_str());
+// DBWriteContactSettingString(hContact, szGPGModuleName, "KeyID_Prescense", out.substr(p1, p2-p1-1).c_str());
+ hcontact_data[hContact].key_in_prescense = out.substr(p1, p2-p1-1).c_str();
}
}
}
@@ -813,7 +814,10 @@ void AddHandlers()
}
extern bool bAutoExchange;
if(bAutoExchange)
- (*p)->getJabberInterface()->Net()->RegisterFeature(_T("GPG Key Auto Exchange"), _T("Indicates that gpg installed and configured to public key auto exchange (currently implemented in new_gpg Miranda IM plugin)"));
+ {
+ (*p)->getJabberInterface()->Net()->RegisterFeature(_T("GPG_Key_Auto_Exchange:0"), _T("Indicates that gpg installed and configured to public key auto exchange (currently implemented in new_gpg Miranda IM plugin)"));
+ (*p)->getJabberInterface()->Net()->AddFeatures(_T("GPG_Key_Auto_Exchange:0\0\0"));
+ }
}
}
@@ -951,4 +955,4 @@ string get_random(int length)
for(int i = 0; i < length; ++i)
data += chars[gen()];
return data;
-} \ No newline at end of file
+}