summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-04-01 19:15:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-04-01 19:15:27 +0300
commit6abd857f75f3ba82de7723875af3011f3438b795 (patch)
tree00039e9da62dcd4c7afc9aafdfd74935331c3520
parent6558159f70c242abf8d478c9661d5d349b5c416e (diff)
Secure IM: obsolete langpack implementation removed
-rw-r--r--plugins/SecureIM/secureim_15.vcxproj1
-rw-r--r--plugins/SecureIM/secureim_15.vcxproj.filters3
-rw-r--r--plugins/SecureIM/secureim_16.vcxproj1
-rw-r--r--plugins/SecureIM/secureim_16.vcxproj.filters3
-rw-r--r--plugins/SecureIM/src/commonheaders.h4
-rw-r--r--plugins/SecureIM/src/crypt_dll.cpp8
-rw-r--r--plugins/SecureIM/src/crypt_misc.cpp2
-rw-r--r--plugins/SecureIM/src/crypt_popups.cpp12
-rw-r--r--plugins/SecureIM/src/language.cpp79
-rw-r--r--plugins/SecureIM/src/language.h78
-rw-r--r--plugins/SecureIM/src/main.cpp31
-rw-r--r--plugins/SecureIM/src/options.cpp85
-rw-r--r--plugins/SecureIM/src/svcs_clist.cpp2
-rw-r--r--plugins/SecureIM/src/svcs_menu.cpp2
-rw-r--r--plugins/SecureIM/src/svcs_proto.cpp27
-rw-r--r--plugins/SecureIM/src/svcs_rsa.cpp22
16 files changed, 109 insertions, 251 deletions
diff --git a/plugins/SecureIM/secureim_15.vcxproj b/plugins/SecureIM/secureim_15.vcxproj
index 0df48a5dd2..374f1ad323 100644
--- a/plugins/SecureIM/secureim_15.vcxproj
+++ b/plugins/SecureIM/secureim_15.vcxproj
@@ -227,7 +227,6 @@
<ClCompile Include="src\dbevent.cpp" />
<ClCompile Include="src\gettime.cpp" />
<ClCompile Include="src\images.cpp" />
- <ClCompile Include="src\language.cpp" />
<ClCompile Include="src\loadicons.cpp" />
<ClCompile Include="src\loadlib.cpp" />
<ClCompile Include="src\main.cpp" />
diff --git a/plugins/SecureIM/secureim_15.vcxproj.filters b/plugins/SecureIM/secureim_15.vcxproj.filters
index c9bb0b4ea3..2bba4ae211 100644
--- a/plugins/SecureIM/secureim_15.vcxproj.filters
+++ b/plugins/SecureIM/secureim_15.vcxproj.filters
@@ -51,9 +51,6 @@
<ClCompile Include="src\images.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\language.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\loadicons.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/SecureIM/secureim_16.vcxproj b/plugins/SecureIM/secureim_16.vcxproj
index 5bdaac10b0..0f59565ed3 100644
--- a/plugins/SecureIM/secureim_16.vcxproj
+++ b/plugins/SecureIM/secureim_16.vcxproj
@@ -227,7 +227,6 @@
<ClCompile Include="src\dbevent.cpp" />
<ClCompile Include="src\gettime.cpp" />
<ClCompile Include="src\images.cpp" />
- <ClCompile Include="src\language.cpp" />
<ClCompile Include="src\loadicons.cpp" />
<ClCompile Include="src\loadlib.cpp" />
<ClCompile Include="src\main.cpp" />
diff --git a/plugins/SecureIM/secureim_16.vcxproj.filters b/plugins/SecureIM/secureim_16.vcxproj.filters
index c9bb0b4ea3..2bba4ae211 100644
--- a/plugins/SecureIM/secureim_16.vcxproj.filters
+++ b/plugins/SecureIM/secureim_16.vcxproj.filters
@@ -51,9 +51,6 @@
<ClCompile Include="src\images.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\language.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\loadicons.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h
index 2f710f4acd..4a4078f231 100644
--- a/plugins/SecureIM/src/commonheaders.h
+++ b/plugins/SecureIM/src/commonheaders.h
@@ -42,11 +42,9 @@
#include "version.h"
#include "resource.h"
#include "../SecureIM_icons/src/resource.h"
-#include "language.h"
#include "mmi.h"
#include "crypt.h"
#include "gettime.h"
-#include "language.h"
#include "options.h"
#include "popupoptions.h"
#include "loadicons.h"
@@ -107,8 +105,6 @@ void SetFlags();
int msgbox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
void CopyToClipboard(HWND hwnd,LPSTR msg);
-#define msgbox0(a,b,c,d) msgbox(a,b,c,d)
-#define msgbox1(a,b,c,d) msgbox(a,b,c,d)
#endif
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp
index b4a9f03614..0f5e049b9a 100644
--- a/plugins/SecureIM/src/crypt_dll.cpp
+++ b/plugins/SecureIM/src/crypt_dll.cpp
@@ -95,7 +95,7 @@ BOOL CalculateKeyX(pUinKey ptr, MCONTACT hContact)
showPopupEC(ptr->hContact);
}
else // agree value problem
- showPopup(sim002, hContact, g_hPOP[POP_PU_DIS], 0);
+ showPopup(LPGEN("Key exchange failed..."), hContact, g_hPOP[POP_PU_DIS], 0);
return agr != 0;
}
@@ -138,14 +138,14 @@ LPSTR decodeMsg(pUinKey ptr, LPARAM lParam, LPSTR szEncMsg)
ptr->decoded = false;
switch (cpp_get_error(ptr->cntx)) {
case CPP_ERROR_BAD_LEN:
- szNewMsg = mir_strdup(Translate(sim102));
+ szNewMsg = mir_strdup(Translate("SecureIM: Error while decrypting the message, bad message length."));
break;
case CPP_ERROR_BAD_CRC:
- szNewMsg = mir_strdup(Translate(sim103));
+ szNewMsg = mir_strdup(Translate("SecureIM: Error while decrypting the message, bad message CRC."));
break;
default:
ptr->decoded = true;
- szNewMsg = mir_strdup(Translate(sim101));
+ szNewMsg = mir_strdup(Translate("SecureIM: Error while decrypting the message."));
break;
}
}
diff --git a/plugins/SecureIM/src/crypt_misc.cpp b/plugins/SecureIM/src/crypt_misc.cpp
index 6017c25719..0dff7e6f78 100644
--- a/plugins/SecureIM/src/crypt_misc.cpp
+++ b/plugins/SecureIM/src/crypt_misc.cpp
@@ -17,7 +17,7 @@ static void sttWaitForExchange(LPVOID param)
// if keyexchange failed or timeout
if (ptr->waitForExchange == 1 || ptr->waitForExchange == 3) { // протухло - отправляем незашифрованно, если надо
- if (ptr->msgQueue && msgbox1(nullptr, sim104, MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if (ptr->msgQueue && msgbox(nullptr, LPGEN("User has not answered to key exchange!\nYour messages are still in SecureIM queue, do you want to send them unencrypted now?"), MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDYES) {
mir_cslock lck(localQueueMutex);
ptr->sendQueue = true;
pWM ptrMessage = ptr->msgQueue;
diff --git a/plugins/SecureIM/src/crypt_popups.cpp b/plugins/SecureIM/src/crypt_popups.cpp
index 93891df7dd..943beb1cee 100644
--- a/plugins/SecureIM/src/crypt_popups.cpp
+++ b/plugins/SecureIM/src/crypt_popups.cpp
@@ -59,19 +59,19 @@ void showPopupDCmsg(MCONTACT hContact, LPCSTR msg)
void showPopupDC(MCONTACT hContact)
{
if (g_plugin.getByte("dc", 1))
- showPopup(sim006, hContact, g_hPOP[POP_PU_DIS], 1);
+ showPopup(LPGEN("SecureIM disabled..."), hContact, g_hPOP[POP_PU_DIS], 1);
}
void showPopupEC(MCONTACT hContact)
{
if (g_plugin.getByte("ec", 1))
- showPopup(sim001, hContact, g_hPOP[POP_PU_EST], 1);
+ showPopup(LPGEN("SecureIM established..."), hContact, g_hPOP[POP_PU_EST], 1);
}
void showPopupKS(MCONTACT hContact)
{
if (g_plugin.getByte("ks", 1))
- showPopup(sim007, hContact, g_hPOP[POP_PU_PRC], 0);
+ showPopup(LPGEN("Sending key..."), hContact, g_hPOP[POP_PU_PRC], 0);
}
void showPopupKRmsg(MCONTACT hContact, LPCSTR msg)
@@ -83,19 +83,19 @@ void showPopupKRmsg(MCONTACT hContact, LPCSTR msg)
void showPopupKR(MCONTACT hContact)
{
if (g_plugin.getByte("kr", 1))
- showPopup(sim008, hContact, g_hPOP[POP_PU_PRC], 0);
+ showPopup(LPGEN("Key received..."), hContact, g_hPOP[POP_PU_PRC], 0);
}
void showPopupSM(MCONTACT hContact)
{
if (g_plugin.getByte("ss", 0))
- showPopup(sim009, hContact, g_hPOP[POP_PU_MSS], 2);
+ showPopup(LPGEN("Sending message..."), hContact, g_hPOP[POP_PU_MSS], 2);
Skin_PlaySound("OutgoingSecureMessage");
}
void showPopupRM(MCONTACT hContact)
{
if (g_plugin.getByte("sr", 0))
- showPopup(sim010, hContact, g_hPOP[POP_PU_MSR], 2);
+ showPopup(LPGEN("Message received..."), hContact, g_hPOP[POP_PU_MSR], 2);
Skin_PlaySound("IncomingSecureMessage");
}
diff --git a/plugins/SecureIM/src/language.cpp b/plugins/SecureIM/src/language.cpp
deleted file mode 100644
index fd89163b81..0000000000
--- a/plugins/SecureIM/src/language.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-#include "commonheaders.h"
-
-//Error Messages
-LPCSTR sim104 = LPGEN();
-LPCSTR sim105 = LPGEN("SecureIM not enabled! You must enable SecureIM with this user...");
-LPCSTR sim106 = LPGEN("Can't send encrypted message!\nUser is offline now and his secure key has been expired. Do you want to send your message?\nIt will be unencrypted!");
-LPCSTR sim107 = LPGEN("SecureIM won't be loaded because cryptopp.dll is missing or wrong version!");
-LPCSTR sim108 = LPGEN("SecureIM can't load PGP/GPG key! Check PGP/GPG settings!");
-LPCSTR sim109 = LPGEN("SecureIM can't encrypt message! Check trust of PGP/GPG key!");
-LPCSTR sim110 = LPGEN("Can't send encrypted message!\nDo you want to send your message?\nIt will be unencrypted!");
-LPCSTR sim111 = LPGEN("Can't change mode! Secure connection established!");
-LPCSTR sim112 = LPGEN("Can't export RSA private key!");
-LPCSTR sim113 = LPGEN("Can't import RSA private key!");
-LPCSTR sim114 = LPGEN("Can't export RSA public key!");
-LPCSTR sim115 = LPGEN("Can't import RSA public key!");
-
-//Options
-
-LPCSTR sim203 = LPGEN("Nickname");
-LPCSTR sim204 = LPGEN("User ID");
-LPCSTR sim205 = LPGEN("Status");
-LPCSTR sim206 = "PSK";
-LPCSTR sim211 = LPGEN("Password is too short!");
-LPCSTR sim212 = LPGEN("ON");
-LPCSTR sim213 = LPGEN("Off");
-LPCSTR sim215 = LPGEN("Key ID");
-LPCSTR sim216 = LPGEN("Keyrings loaded.");
-LPCSTR sim217 = LPGEN("Keyrings not loaded!");
-LPCSTR sim218 = LPGEN("PGP SDK v%i.%i.%i found.");
-LPCSTR sim219 = LPGEN("PGP SDK not found!");
-LPCSTR sim220 = LPGEN("This version not supported!");
-LPCSTR sim221 = LPGEN("(none)");
-LPCSTR sim222 = LPGEN("Private key loaded.");
-LPCSTR sim223 = LPGEN("Private key not loaded!");
-LPCSTR sim224 = LPGEN("The new settings will become valid when you restart Miranda NG!");
-LPCSTR sim225 = LPGEN("Keyrings disabled!");
-LPCSTR sim227 = "CP";
-LPCSTR sim228 = "ANSI";
-LPCSTR sim229 = "UTF-8";
-LPCSTR sim230 = LPGEN("Mode");
-LPCSTR sim231[] = { LPGEN("Native"), "PGP", "GPG", "RSA/AES", "RSA" };
-LPCSTR sim232[] = { LPGEN("Disabled"), LPGEN("Enabled"), LPGEN("Always try") };
-LPCSTR sim233 = "PUB";
-LPCSTR sim234 = "SHA-1";
-
-//Context Menu
-LPCWSTR sim301 = LPGENW("Create SecureIM connection");
-LPCWSTR sim302 = LPGENW("Disable SecureIM connection");
-LPCWSTR sim306 = LPGENW("Load PGP Key");
-LPCWSTR sim307 = LPGENW("Unload PGP Key");
-LPCWSTR sim308 = LPGENW("Load GPG Key");
-LPCWSTR sim309 = LPGENW("Unload GPG Key");
-LPCWSTR sim310 = LPGENW("Delete RSA Key");
-LPCWSTR sim311[] = { LPGENW("SecureIM mode (Native)"),
- LPGENW("SecureIM mode (PGP)"),
- LPGENW("SecureIM mode (GPG)"),
- LPGENW("SecureIM mode (RSA/AES)"),
- LPGENW("SecureIM mode (RSA)") };
-LPCWSTR sim312[] = { LPGENW("SecureIM status (disabled)"),
- LPGENW("SecureIM status (enabled)"),
- LPGENW("SecureIM status (always try)") };
-
-//System messages
-LPCSTR sim401 = LPGEN("SecureIM: Sorry, unable to decrypt this message because you have no PGP/GPG installed. Visit www.pgp.com or www.gnupg.org for more info.");
-LPCSTR sim402 = LPGEN("SecureIM received unencrypted message:\n");
-LPCSTR sim403 = LPGEN("SecureIM received encrypted message:\n");
-
-//RSA messages
-LPCSTR sim501 = LPGEN("Session closed by receiving incorrect message type");
-LPCSTR sim502 = LPGEN("Session closed by other side on error");
-LPCSTR sim505 = LPGEN("Error while decoding AES message");
-LPCSTR sim506 = LPGEN("Error while decoding RSA message");
-LPCSTR sim507 = LPGEN("Session closed on timeout");
-LPCSTR sim508 = LPGEN("Session closed by other side when status \"disabled\"");
-LPCSTR sim510 = LPGEN("Session closed on error: %02x");
-LPCSTR sim520 = LPGEN("SecureIM received RSA Public Key from \"%s\"\n\nSHA-1: %s\n\nDo you Accept this Key?");
-LPCSTR sim521 = LPGEN("SecureIM auto accepted RSA Public key from: %s uin: %s SHA-1: %s");
-LPCSTR sim522 = LPGEN("SecureIM received NEW RSA Public Key from \"%s\"\n\nNew SHA-1: %s\n\nOld SHA-1: %s\n\nDo you Replace this Key?");
-LPCSTR sim523 = LPGEN("SecureIM auto accepted NEW RSA Public key from: %s uin: %s New SHA-1: %s Old SHA-1: %s");
diff --git a/plugins/SecureIM/src/language.h b/plugins/SecureIM/src/language.h
deleted file mode 100644
index 7e52510865..0000000000
--- a/plugins/SecureIM/src/language.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef __LANGUAGE_H__
-#define __LANGUAGE_H__
-
-//Error Messages
-extern LPCSTR sim101;
-extern LPCSTR sim102;
-extern LPCSTR sim103;
-extern LPCSTR sim104;
-extern LPCSTR sim105;
-extern LPCSTR sim106;
-extern LPCSTR sim107;
-extern LPCSTR sim108;
-extern LPCSTR sim109;
-extern LPCSTR sim110;
-extern LPCSTR sim111;
-extern LPCSTR sim112;
-extern LPCSTR sim113;
-extern LPCSTR sim114;
-extern LPCSTR sim115;
-
-//Options
-extern LPCSTR sim203;
-extern LPCSTR sim204;
-extern LPCSTR sim205;
-extern LPCSTR sim206;
-extern LPCSTR sim211;
-extern LPCSTR sim212;
-extern LPCSTR sim213;
-extern LPCSTR sim215;
-extern LPCSTR sim216;
-extern LPCSTR sim217;
-extern LPCSTR sim218;
-extern LPCSTR sim219;
-extern LPCSTR sim220;
-extern LPCSTR sim221;
-extern LPCSTR sim222;
-extern LPCSTR sim223;
-extern LPCSTR sim224;
-extern LPCSTR sim225;
-extern LPCSTR sim227;
-extern LPCSTR sim228;
-extern LPCSTR sim229;
-extern LPCSTR sim230;
-extern LPCSTR sim231[];
-extern LPCSTR sim232[];
-extern LPCSTR sim233;
-extern LPCSTR sim234;
-
-//Context Menu
-extern LPCWSTR sim301;
-extern LPCWSTR sim302;
-extern LPCWSTR sim306;
-extern LPCWSTR sim307;
-extern LPCWSTR sim308;
-extern LPCWSTR sim309;
-extern LPCWSTR sim310;
-extern LPCWSTR sim311[];
-extern LPCWSTR sim312[];
-
-//System messages
-extern LPCSTR sim401;
-extern LPCSTR sim402;
-extern LPCSTR sim403;
-
-//RSA messages
-extern LPCSTR sim501;
-extern LPCSTR sim502;
-extern LPCSTR sim505;
-extern LPCSTR sim506;
-extern LPCSTR sim507;
-extern LPCSTR sim508;
-extern LPCSTR sim510;
-extern LPCSTR sim520;
-extern LPCSTR sim521;
-extern LPCSTR sim522;
-extern LPCSTR sim523;
-
-#endif
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index fb9fcee22b..beeeddc9f0 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -24,6 +24,23 @@ CMPlugin::CMPlugin() :
/////////////////////////////////////////////////////////////////////////////////////////
// basic events: onModuleLoad, onModulesLoad, onShutdown
+LPCWSTR sim311[] = {
+ LPGENW("SecureIM mode (Native)"),
+ LPGENW("SecureIM mode (PGP)"),
+ LPGENW("SecureIM mode (GPG)"),
+ LPGENW("SecureIM mode (RSA/AES)"),
+ LPGENW("SecureIM mode (RSA)")
+};
+
+LPCWSTR sim312[] = {
+ LPGENW("SecureIM status (disabled)"),
+ LPGENW("SecureIM status (enabled)"),
+ LPGENW("SecureIM status (always try)")
+};
+
+LPCSTR sim231[] = { LPGEN("Native"), "PGP", "GPG", "RSA/AES", "RSA" };
+LPCSTR sim232[] = { LPGEN("Disabled"), LPGEN("Enabled"), LPGEN("Always try") };
+
static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon, LPCSTR service, int flags = 0, WPARAM wParam = 0)
{
CMenuItem mi(&g_plugin);
@@ -208,8 +225,8 @@ static int onModulesLoaded(WPARAM, LPARAM)
CreateProtoServiceFunction(MODULENAME, PSS_MESSAGE, onSendMsg);
// create a menu item for creating a secure im connection to the user.
- g_hMenu[0] = MyAddMenuItem(sim301, 110000, "5A8C2F35-4699-43A4-A820-516DEB83FCA1", g_hICO[ICO_CM_EST], MODULENAME"/SIM_EST", CMIF_NOTOFFLINE);
- g_hMenu[1] = MyAddMenuItem(sim302, 110001, "0B092254-DA91-42D6-A89D-365981BB3D91", g_hICO[ICO_CM_DIS], MODULENAME"/SIM_DIS", CMIF_NOTOFFLINE);
+ g_hMenu[0] = MyAddMenuItem(LPGENW("Create SecureIM connection"), 110000, "5A8C2F35-4699-43A4-A820-516DEB83FCA1", g_hICO[ICO_CM_EST], MODULENAME"/SIM_EST", CMIF_NOTOFFLINE);
+ g_hMenu[1] = MyAddMenuItem(LPGENW("Disable SecureIM connection"), 110001, "0B092254-DA91-42D6-A89D-365981BB3D91", g_hICO[ICO_CM_DIS], MODULENAME"/SIM_DIS", CMIF_NOTOFFLINE);
g_hMenu[2] = MyAddMenuItem(sim312[0], 110002, "635576BB-A927-4F64-B205-DD464F57CC99", nullptr, nullptr);
g_hMenu[3] = MyAddSubItem(g_hMenu[2], sim232[0], 110003, 110002, MODULENAME"/SIM_ST_DIS");
@@ -217,13 +234,13 @@ static int onModulesLoaded(WPARAM, LPARAM)
g_hMenu[5] = MyAddSubItem(g_hMenu[2], sim232[2], 110005, 110002, MODULENAME"/SIM_ST_TRY");
if (bPGPloaded) {
- g_hMenu[6] = MyAddMenuItem(sim306, 110006, "33829541-85B9-499E-9605-4DDADE1A4B33", mode2icon(MODE_PGP | SECURED, 2), MODULENAME"/PGP_SET", 0);
- g_hMenu[7] = MyAddMenuItem(sim307, 110007, "25530E70-8349-419D-9F4F-FA748E485E2B", mode2icon(MODE_PGP, 2), MODULENAME"/PGP_DEL", 0);
+ g_hMenu[6] = MyAddMenuItem(LPGENW("Load PGP Key"), 110006, "33829541-85B9-499E-9605-4DDADE1A4B33", mode2icon(MODE_PGP | SECURED, 2), MODULENAME"/PGP_SET", 0);
+ g_hMenu[7] = MyAddMenuItem(LPGENW("Unload PGP Key"), 110007, "25530E70-8349-419D-9F4F-FA748E485E2B", mode2icon(MODE_PGP, 2), MODULENAME"/PGP_DEL", 0);
}
if (bGPGloaded) {
- g_hMenu[8] = MyAddMenuItem(sim308, 110008, "D8BD7B70-3E6C-4A09-9612-4E4E2FCBBB8A", mode2icon(MODE_GPG | SECURED, 2), MODULENAME"/GPG_SET", 0);
- g_hMenu[9] = MyAddMenuItem(sim309, 110009, "5C60AD6F-6B1B-4758-BB68-C008168BF32B", mode2icon(MODE_GPG, 2), MODULENAME"/GPG_DEL", 0);
+ g_hMenu[8] = MyAddMenuItem(LPGENW("Load GPG Key"), 110008, "D8BD7B70-3E6C-4A09-9612-4E4E2FCBBB8A", mode2icon(MODE_GPG | SECURED, 2), MODULENAME"/GPG_SET", 0);
+ g_hMenu[9] = MyAddMenuItem(LPGENW("Unload GPG Key"), 110009, "5C60AD6F-6B1B-4758-BB68-C008168BF32B", mode2icon(MODE_GPG, 2), MODULENAME"/GPG_DEL", 0);
}
g_hMenu[10] = MyAddMenuItem(sim311[0], 110010, "D56DD118-863B-4069-9A6A-C0057BA99CC6", nullptr, nullptr);
@@ -299,7 +316,7 @@ int CMPlugin::Load(void)
// load crypo++ dll
if (!loadlib()) {
- msgbox1(nullptr, sim107, MODULENAME, MB_OK | MB_ICONSTOP);
+ msgbox(nullptr, LPGEN("SecureIM won't be loaded because cryptopp.dll is missing or wrong version!"), MODULENAME, MB_OK | MB_ICONSTOP);
return 1;
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index b5d9b4bd12..4f17f26e38 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -102,6 +102,7 @@ static void setListViewIcon(HWND hLV, UINT iItem, pUinKey ptr)
static void setListViewMode(HWND hLV, UINT iItem, UINT iMode)
{
+ extern LPCSTR sim231[];
char tmp[256];
strncpy(tmp, Translate(sim231[iMode]), sizeof(tmp) - 1);
LV_SetItemTextA(hLV, iItem, 2, tmp);
@@ -109,6 +110,7 @@ static void setListViewMode(HWND hLV, UINT iItem, UINT iMode)
static void setListViewStatus(HWND hLV, UINT iItem, UINT iStatus)
{
+ extern LPCSTR sim232[];
char tmp[128];
strncpy(tmp, Translate(sim232[iStatus]), sizeof(tmp) - 1);
LV_SetItemTextA(hLV, iItem, 3, tmp);
@@ -118,13 +120,13 @@ static UINT getListViewPSK(HWND hLV, UINT iItem)
{
char str[128];
LV_GetItemTextA(hLV, iItem, 4, str, _countof(str));
- return strncmp(str, Translate(sim206), sizeof(str)) == 0;
+ return strncmp(str, Translate("PSK"), sizeof(str)) == 0;
}
static void setListViewPSK(HWND hLV, UINT iItem, UINT iStatus)
{
char str[128];
- strncpy(str, (iStatus) ? Translate(sim206) : "-", sizeof(str) - 1);
+ strncpy(str, (iStatus) ? Translate("PSK") : "-", sizeof(str) - 1);
LV_SetItemTextA(hLV, iItem, 4, str);
}
@@ -132,13 +134,13 @@ static UINT getListViewPUB(HWND hLV, UINT iItem)
{
char str[128];
LV_GetItemTextA(hLV, iItem, 4, str, _countof(str));
- return strncmp(str, Translate(sim233), sizeof(str)) == 0;
+ return strncmp(str, Translate("PUB"), sizeof(str)) == 0;
}
static void setListViewPUB(HWND hLV, UINT iItem, UINT iStatus)
{
char str[128];
- strncpy(str, (iStatus) ? Translate(sim233) : "-", sizeof(str) - 1);
+ strncpy(str, (iStatus) ? Translate("PUB") : "-", sizeof(str) - 1);
LV_SetItemTextA(hLV, iItem, 4, str);
LPSTR sha = nullptr;
@@ -157,7 +159,7 @@ static void setListViewPUB(HWND hLV, UINT iItem, UINT iStatus)
LV_SetItemTextA(hLV, iItem, 5, sha);
mir_free(sha);
}
- else LV_SetItemTextA(hLV, iItem, 5, "");
+ else LV_SetItemTextA(hLV, iItem, 5, "");
}
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
@@ -527,7 +529,7 @@ static INT_PTR CALLBACK DlgProcSetPSK(HWND hDlg, UINT uMsg, WPARAM wParam, LPARA
switch (LOWORD(wParam)) {
case IDOK:
if (GetDlgItemTextA(hDlg, IDC_EDIT1, buffer, PSKSIZE) < 8) {
- msgbox1(hDlg, sim211, MODULENAME, MB_OK | MB_ICONEXCLAMATION);
+ msgbox(hDlg, LPGEN("Password is too short!"), MODULENAME, MB_OK | MB_ICONEXCLAMATION);
return TRUE;
}
EndDialog(hDlg, IDOK);
@@ -591,7 +593,7 @@ static void ApplyGeneralSettings(HWND hDlg)
g_plugin.setByte("gpg", bGPG);
}
if (tmp)
- msgbox1(hDlg, sim224, MODULENAME, MB_OK | MB_ICONINFORMATION);
+ msgbox(hDlg, LPGEN("The new settings will become valid when you restart Miranda NG!"), MODULENAME, MB_OK | MB_ICONINFORMATION);
HWND hLV = GetDlgItem(hDlg, IDC_STD_USERLIST);
i = ListView_GetNextItem(hLV, (UINT)-1, LVNI_ALL);
@@ -650,13 +652,13 @@ static INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wPara
ListView_SetImageList(hLV, hSmall, LVSIL_SMALL);
ListView_SetImageList(hLV, hLarge, LVSIL_NORMAL);
{
- static const char *szColHdr[] = { sim203, sim204, sim230, sim205, "", sim234, nullptr };
+ static const char *szColHdr[] = { LPGEN("Nickname"), LPGEN("User ID"), LPGEN("Mode"), LPGEN("Status"), "", "SHA-1" };
static int iColWidth[] = { 150, 110, 60, 55, 35, 330 };
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
- for (i = 0; szColHdr[i]; i++) {
+ for (i = 0; i < _countof(szColHdr); i++) {
lvc.iSubItem = i;
lvc.pszText = (LPSTR)szColHdr[i];
lvc.cx = iColWidth[i];
@@ -751,7 +753,7 @@ static INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wPara
LPSTR buffer = (LPSTR)alloca(RSASIZE);
mir_exp->rsa_export_pubkey(ptr->cntx, buffer);
if (!SaveExportRSAKeyDlg(hDlg, buffer, 0))
- msgbox(hDlg, sim114, MODULENAME, MB_OK | MB_ICONEXCLAMATION);
+ msgbox(hDlg, LPGEN("Can't export RSA public key!"), MODULENAME, MB_OK | MB_ICONEXCLAMATION);
}
}
return TRUE;
@@ -770,7 +772,7 @@ static INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wPara
setListViewPUB(hLV, idx, 1);
}
- else msgbox(hDlg, sim115, MODULENAME, MB_OK | MB_ICONEXCLAMATION);
+ else msgbox(hDlg, LPGEN("Can't import RSA public key!"), MODULENAME, MB_OK | MB_ICONEXCLAMATION);
}
return TRUE;
@@ -1043,7 +1045,7 @@ static INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam,
LPSTR pub = (LPSTR)alloca(RSASIZE);
mir_exp->rsa_export_keypair(CPP_MODE_RSA, nullptr, pub, nullptr);
if (!SaveExportRSAKeyDlg(hDlg, pub, 0))
- msgbox(hDlg, sim114, MODULENAME, MB_OK | MB_ICONEXCLAMATION);
+ msgbox(hDlg, LPGEN("Can't export RSA public key!"), MODULENAME, MB_OK | MB_ICONEXCLAMATION);
}
return TRUE;
@@ -1055,7 +1057,7 @@ static INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam,
LPSTR priv = (LPSTR)alloca(RSASIZE);
mir_exp->rsa_export_keypair(CPP_MODE_RSA, priv, nullptr, passphrase);
if (!SaveExportRSAKeyDlg(hDlg, priv, 1))
- msgbox(hDlg, sim112, MODULENAME, MB_OK | MB_ICONEXCLAMATION);
+ msgbox(hDlg, LPGEN("Can't export RSA private key!"), MODULENAME, MB_OK | MB_ICONEXCLAMATION);
}
}
return TRUE;
@@ -1070,7 +1072,7 @@ static INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam,
int res = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_PASSPHRASE), nullptr, DlgProcSetPassphrase, (LPARAM)passphrase);
if (res == IDOK) {
if (!mir_exp->rsa_import_keypair(CPP_MODE_RSA, priv, passphrase))
- msgbox(hDlg, sim113, MODULENAME, MB_OK | MB_ICONEXCLAMATION);
+ msgbox(hDlg, LPGEN("Can't import RSA private key!"), MODULENAME, MB_OK | MB_ICONEXCLAMATION);
else // обновить SHA-1 значение
RefreshProtoDlg(hDlg);
}
@@ -1138,26 +1140,36 @@ static INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam,
static BOOL bPGP9;
+static void OnChange_KeyRings(HWND hDlg)
+{
+ BOOL bNoKR = (IsDlgButtonChecked(hDlg, IDC_NO_KEYRINGS) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_SET_KEYRINGS), !bNoKR);
+ EnableWindow(GetDlgItem(hDlg, IDC_LOAD_PRIVKEY), bNoKR);
+ if (bNoKR)
+ SetDlgItemTextW(hDlg, IDC_KEYRING_STATUS, TranslateT("Keyrings disabled!"));
+ else if (bPGP9)
+ SetDlgItemTextW(hDlg, IDC_KEYRING_STATUS, TranslateT("This version not supported!"));
+ else
+ SetDlgItemTextW(hDlg, IDC_KEYRING_STATUS, bPGPkeyrings ? TranslateT("Keyrings loaded.") : TranslateT("Keyrings not loaded!"));
+}
+
static void RefreshPGPDlg(HWND hDlg, BOOL iInit)
{
int ver = pgp_get_version();
bPGP9 = (ver >= 0x03050000);
- EnableWindow(GetDlgItem(hDlg, IDC_SET_KEYRINGS), bUseKeyrings && !bPGP9);
- EnableWindow(GetDlgItem(hDlg, IDC_LOAD_PRIVKEY), !bUseKeyrings);
- SetDlgItemText(hDlg, IDC_PGP_PRIVKEY, bPGPprivkey ? Translate(sim222) : Translate(sim223));
+ SetDlgItemTextW(hDlg, IDC_PGP_PRIVKEY, bPGPprivkey ? TranslateT("Private key loaded.") : TranslateT("Private key not loaded!"));
if (bPGPloaded && ver) {
- char pgpVerStr[64];
- mir_snprintf(pgpVerStr, Translate(sim218), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
- SetDlgItemText(hDlg, IDC_PGP_SDK, pgpVerStr);
+ wchar_t pgpVerStr[64];
+ mir_snwprintf(pgpVerStr, TranslateT("PGP SDK v%i.%i.%i found."), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
+ SetDlgItemTextW(hDlg, IDC_PGP_SDK, pgpVerStr);
}
- else SetDlgItemText(hDlg, IDC_PGP_SDK, Translate(sim219));
-
- SetDlgItemText(hDlg, IDC_KEYRING_STATUS, !bUseKeyrings ? Translate(sim225) : ((bPGP9) ? Translate(sim220) : (bPGPkeyrings ? Translate(sim216) : Translate(sim217))));
+ else SetDlgItemTextW(hDlg, IDC_PGP_SDK, TranslateT("PGP SDK not found!"));
// Disable keyrings use
CheckDlgButton(hDlg, IDC_NO_KEYRINGS, (bUseKeyrings) ? BST_UNCHECKED : BST_CHECKED);
+ OnChange_KeyRings(hDlg);
// rebuild list of contacts
HWND hLV = GetDlgItem(hDlg, IDC_PGP_USERLIST);
@@ -1182,7 +1194,7 @@ static void RefreshPGPDlg(HWND hDlg, BOOL iInit)
getContactUin(hContact, tmp);
LV_SetItemText(hLV, itemNum, 1, tmp);
- LV_SetItemTextA(hLV, itemNum, 2, (szKeyID) ? szKeyID : Translate(sim221));
+ LV_SetItemTextA(hLV, itemNum, 2, (szKeyID) ? szKeyID : Translate("(none)"));
SAFE_FREE(szKeyID);
}
}
@@ -1229,12 +1241,12 @@ static INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, L
ListView_SetImageList(hLV, hSmall, LVSIL_SMALL);
ListView_SetImageList(hLV, hLarge, LVSIL_NORMAL);
{
- static const char *szColHdr[] = { sim203, sim204, sim215, nullptr };
+ static const char *szColHdr[] = { LPGEN("Nickname"), LPGEN("User ID"), LPGEN("Key ID") };
static int iColWidth[] = { 160, 150, 80 };
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
- for (i = 0; szColHdr[i]; i++) {
+ for (i = 0; _countof(szColHdr); i++) {
lvc.iSubItem = i;
lvc.pszText = (LPSTR)szColHdr[i];
lvc.cx = iColWidth[i];
@@ -1266,17 +1278,12 @@ static INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, L
g_plugin.setString("pgpPubRing", PubRingPath);
g_plugin.setString("pgpSecRing", SecRingPath);
}
- SetDlgItemText(hDlg, IDC_KEYRING_STATUS, bPGPkeyrings ? Translate(sim216) : Translate(sim217));
+ SetDlgItemText(hDlg, IDC_KEYRING_STATUS, bPGPkeyrings ? Translate("Keyrings loaded.") : Translate("Keyrings not loaded!"));
}
return FALSE;
case IDC_NO_KEYRINGS:
- {
- BOOL bNoKR = (IsDlgButtonChecked(hDlg, IDC_NO_KEYRINGS) == BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg, IDC_SET_KEYRINGS), !bNoKR);
- EnableWindow(GetDlgItem(hDlg, IDC_LOAD_PRIVKEY), bNoKR);
- SetDlgItemText(hDlg, IDC_KEYRING_STATUS, bNoKR ? Translate(sim225) : ((bPGP9) ? Translate(sim220) : (bPGPkeyrings ? Translate(sim216) : Translate(sim217))));
- }
+ OnChange_KeyRings(hDlg);
break;
case IDC_LOAD_PRIVKEY:
@@ -1376,7 +1383,7 @@ static void RefreshGPGDlg(HWND hDlg, BOOL iInit)
if (iInit)
ptr->tgpgMode = ptr->gpgMode;
- LPSTR szKeyID = g_plugin.getStringA(hContact, "gpg");
+ ptrW szKeyID(g_plugin.getWStringA(hContact, "gpg"));
lvi.iItem++;
lvi.iImage = (szKeyID != nullptr);
@@ -1387,8 +1394,8 @@ static void RefreshGPGDlg(HWND hDlg, BOOL iInit)
getContactUin(hContact, tmp);
LV_SetItemText(hLV, itemNum, 1, tmp);
- LV_SetItemTextA(hLV, itemNum, 2, (szKeyID) ? szKeyID : Translate(sim221));
- LV_SetItemTextA(hLV, itemNum, 3, (ptr->tgpgMode) ? Translate(sim228) : Translate(sim229));
+ LV_SetItemText(hLV, itemNum, 2, (szKeyID) ? szKeyID : TranslateT("(none)"));
+ LV_SetItemText(hLV, itemNum, 3, (ptr->tgpgMode) ? TranslateT("ANSI") : TranslateT("UTF-8"));
SAFE_FREE(szKeyID);
}
}
@@ -1461,12 +1468,12 @@ static INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, L
ListView_SetImageList(hLV, hSmall, LVSIL_SMALL);
ListView_SetImageList(hLV, hLarge, LVSIL_NORMAL);
{
- static const char *szColHdr[] = { sim203, sim204, sim215, sim227, nullptr };
+ static const char *szColHdr[] = { LPGEN("Nickname"), LPGEN("User ID"), LPGEN("Key ID"), "CP" };
static int iColWidth[] = { 140, 120, 120, 40 };
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
- for (i = 0; szColHdr[i]; i++) {
+ for (i = 0; i < _countof(szColHdr); i++) {
lvc.iSubItem = i;
lvc.pszText = (LPSTR)szColHdr[i];
lvc.cx = iColWidth[i];
@@ -1542,7 +1549,7 @@ static INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, L
ptr = (pUinKey)getListViewParam(hLV, idx);
if (!ptr) break;
ptr->tgpgMode++; ptr->tgpgMode &= 1;
- LV_SetItemTextA(hLV, LPNMLISTVIEW(lParam)->iItem, LPNMLISTVIEW(lParam)->iSubItem, (ptr->tgpgMode) ? Translate(sim228) : Translate(sim229));
+ LV_SetItemText(hLV, LPNMLISTVIEW(lParam)->iItem, LPNMLISTVIEW(lParam)->iSubItem, (ptr->tgpgMode) ? TranslateT("ANSI") : TranslateT("UTF-8"));
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
break;
diff --git a/plugins/SecureIM/src/svcs_clist.cpp b/plugins/SecureIM/src/svcs_clist.cpp
index c2c00b19ed..26a1702f61 100644
--- a/plugins/SecureIM/src/svcs_clist.cpp
+++ b/plugins/SecureIM/src/svcs_clist.cpp
@@ -102,6 +102,7 @@ int __cdecl onRebuildContactMenu(WPARAM hContact, LPARAM)
// set status menu
if (bSCM && !bMC && (!isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) {
+ extern LPCWSTR sim312[];
Menu_ModifyItem(g_hMenu[2], sim312[ptr->status], g_hICO[ICO_ST_DIS + ptr->status], 0);
for (int i = 0; i <= (ptr->mode == MODE_RSAAES ? 1 : 2); i++)
@@ -121,6 +122,7 @@ int __cdecl onRebuildContactMenu(WPARAM hContact, LPARAM)
if (isSecureProto && !isChat && isMiranda) {
// set mode menu
if (bMCM && !bMC && (!isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) {
+ extern LPCWSTR sim311[];
Menu_ModifyItem(g_hMenu[10], sim311[ptr->mode], g_hICO[ICO_OV_NAT + ptr->mode], 0);
for (int i = 0; i < MODE_CNT; i++) {
diff --git a/plugins/SecureIM/src/svcs_menu.cpp b/plugins/SecureIM/src/svcs_menu.cpp
index ac1b0f9c5f..b99b2409fb 100644
--- a/plugins/SecureIM/src/svcs_menu.cpp
+++ b/plugins/SecureIM/src/svcs_menu.cpp
@@ -150,7 +150,7 @@ INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam)
case MODE_NATIVE:
case MODE_RSAAES:
if (isContactSecured(wParam)&SECURED) {
- msgbox(nullptr, sim111, MODULENAME, MB_OK);
+ msgbox(nullptr, LPGEN("Can't change mode! Secure connection established!"), MODULENAME, MB_OK);
return 0;
}
if (lParam != MODE_NATIVE && ptr->status > STATUS_ENABLED)
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp
index d2405a10d0..f1819c0b29 100644
--- a/plugins/SecureIM/src/svcs_proto.cpp
+++ b/plugins/SecureIM/src/svcs_proto.cpp
@@ -76,7 +76,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
if (ssig == SiG_NONE && !ptr->msgSplitted) {
Sent_NetLog("onRecvMsg: non-secure message");
- ptrA szPlainMsg(m_aastrcat(Translate(sim402), szEncMsg));
+ ptrA szPlainMsg(m_aastrcat(Translate("SecureIM received unencrypted message:\n"), szEncMsg));
ppre->szMessage = szPlainMsg;
ccs->wParam |= PREF_SIMNOMETA;
return Proto_ChainRecv(wParam, ccs);
@@ -93,7 +93,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
ccs->szProtoService = PSS_MESSAGE;
Proto_ChainSend(wParam, ccs);
- showPopup(sim003, ccs->hContact, g_hPOP[POP_PU_DIS], 0);
+ showPopup(LPGEN("Key from disabled..."), ccs->hContact, g_hPOP[POP_PU_DIS], 0);
}
else {
createRSAcntx(ptr);
@@ -150,13 +150,13 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
if (!szOldMsg) { // error while decrypting message, send error
SAFE_FREE(ptr->msgSplitted);
- ppre->szMessage = Translate(sim401);
+ ppre->szMessage = Translate("SecureIM: Sorry, unable to decrypt this message because you have no PGP/GPG installed. Visit www.pgp.com or www.gnupg.org for more info.");
return Proto_ChainRecv(wParam, ccs);
}
// receive encrypted message in non-encrypted mode
if (!isContactPGP(ccs->hContact) && !isContactGPG(ccs->hContact)) {
- szNewMsg = m_ustrcat(Translate(sim403), szOldMsg);
+ szNewMsg = m_ustrcat(Translate("SecureIM received encrypted message:\n"), szOldMsg);
szOldMsg = szNewMsg;
}
ptrA szMsgUtf(utf8_to_miranda(szOldMsg, ppre->flags));
@@ -235,7 +235,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
ccs->lParam = keyToSend;
Proto_ChainSend(wParam, ccs); // send new key
- showPopup(sim005, NULL, g_hPOP[POP_PU_DIS], 0);
+ showPopup(LPGEN("Sending back secure message..."), NULL, g_hPOP[POP_PU_DIS], 0);
showPopupKS(ptr->hContact);
return 1;
}
@@ -273,7 +273,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
// decrypt sended back message and save message for future sending with a new secret key
addMsg2Queue(ptr, ccs->wParam, ptrA(decodeMsg(ptr, (LPARAM)ccs, szEncMsg)));
showPopupRM(ptr->hContact);
- showPopup(sim004, NULL, g_hPOP[POP_PU_DIS], 0);
+ showPopup(LPGEN("Sent back message received..."), NULL, g_hPOP[POP_PU_DIS], 0);
}
return 1; // don't display it ...
@@ -317,7 +317,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
Sent_NetLog("onRecvMsg: SiG_KEYR InitKeyB error");
// tell to the other side that we have the plugin disabled with him
- showPopup(sim013, ptr->hContact, g_hPOP[POP_PU_DIS], 0);
+ showPopup(LPGEN("Bad key received..."), ptr->hContact, g_hPOP[POP_PU_DIS], 0);
ShowStatusIconNotify(ptr->hContact);
waitForExchange(ptr, 3); // дослать нешифрованно
@@ -381,7 +381,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
Sent_NetLog("onRecvMsg: SiG_KEYA InitKeyB error");
// tell to the other side that we have the plugin disabled with him
- showPopup(sim013, ptr->hContact, g_hPOP[POP_PU_DIS], 0);
+ showPopup(LPGEN("Bad key received..."), ptr->hContact, g_hPOP[POP_PU_DIS], 0);
ShowStatusIconNotify(ptr->hContact);
waitForExchange(ptr, 3); // дослать нешифрованно
@@ -409,7 +409,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
Sent_NetLog("onRecvMsg: SiG_KEYB InitKeyB error");
// tell to the other side that we have the plugin disabled with him
- showPopup(sim013, ptr->hContact, g_hPOP[POP_PU_DIS], 0);
+ showPopup(LPGEN("Bad key received..."), ptr->hContact, g_hPOP[POP_PU_DIS], 0);
ShowStatusIconNotify(ptr->hContact);
cpp_reset_context(ptr->cntx);
@@ -477,7 +477,8 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam)
}
if (!ptr->keyLoaded && bPGPloaded) ptr->keyLoaded = LoadKeyPGP(ptr);
if (!ptr->keyLoaded && bGPGloaded) ptr->keyLoaded = LoadKeyGPG(ptr);
- if (!ptr->keyLoaded) return returnError(ccs->hContact, Translate(sim108));
+ if (!ptr->keyLoaded)
+ return returnError(ccs->hContact, Translate("SecureIM can't load PGP/GPG key! Check PGP/GPG settings!"));
LPSTR szNewMsg = nullptr;
ptrA szUtfMsg(miranda_to_utf8((LPCSTR)ccs->lParam, ccs->wParam));
@@ -487,7 +488,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam)
szNewMsg = gpg_encode(ptr->cntx, szUtfMsg);
if (!szNewMsg)
- return returnError(ccs->hContact, Translate(sim109));
+ return returnError(ccs->hContact, Translate("SecureIM can't encrypt message! Check trust of PGP/GPG key!"));
// отправляем зашифрованное сообщение
splitMessageSend(ptr, szNewMsg);
@@ -601,7 +602,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam)
// if user try initialize connection
if (ssig == SiG_INIT) // secure IM is disabled ...
- return returnError(ccs->hContact, Translate(sim105));
+ return returnError(ccs->hContact, Translate("SecureIM not enabled! You must enable SecureIM with this user..."));
if (ptr->cntx) { // if secure context exists
cpp_delete_context(ptr->cntx); ptr->cntx = nullptr;
@@ -649,7 +650,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam)
else {
db_unset(ptr->hContact, MODULENAME, "offlineKey");
db_unset(ptr->hContact, MODULENAME, "offlineKeyTimeout");
- if (msgbox1(nullptr, sim106, MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDNO)
+ if (IDNO == msgbox(nullptr, LPGEN("Can't send encrypted message!\nUser is offline now and his secure key has been expired. Do you want to send your message?\nIt will be unencrypted!"), MODULENAME, MB_YESNO | MB_ICONQUESTION))
return returnNoError(ccs->hContact);
// exit and send unencrypted message
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp
index e4a0f226e8..7518761418 100644
--- a/plugins/SecureIM/src/svcs_rsa.cpp
+++ b/plugins/SecureIM/src/svcs_rsa.cpp
@@ -51,9 +51,9 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int
}
if (bAAK) {
if (k)
- mir_snprintf(msg, MSGSIZE, Translate(sim523), cnm, uin, sha, sha_old);
+ mir_snprintf(msg, MSGSIZE, Translate("SecureIM auto accepted NEW RSA Public key from: %s uin: %s New SHA-1: %s Old SHA-1: %s"), cnm, uin, sha, sha_old);
else
- mir_snprintf(msg, MSGSIZE, Translate(sim521), cnm, uin, sha);
+ mir_snprintf(msg, MSGSIZE, Translate("SecureIM auto accepted RSA Public key from: %s uin: %s SHA-1: %s"), cnm, uin, sha);
showPopupKRmsg(ptr->hContact, msg);
HistoryLog(ptr->hContact, msg);
v = 1;
@@ -63,9 +63,9 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int
}
else {
if (k)
- mir_snprintf(msg, MSGSIZE, Translate(sim522), cnm, sha, sha_old);
+ mir_snprintf(msg, MSGSIZE, Translate("SecureIM received NEW RSA Public Key from \"%s\"\n\nNew SHA-1: %s\n\nOld SHA-1: %s\n\nDo you Replace this Key?"), cnm, sha, sha_old);
else
- mir_snprintf(msg, MSGSIZE, Translate(sim520), cnm, sha);
+ mir_snprintf(msg, MSGSIZE, Translate("SecureIM received RSA Public Key from \"%s\"\n\nSHA-1: %s\n\nDo you Accept this Key?"), cnm, sha);
v = (msgbox(nullptr, msg, MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDYES);
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_check_pub: manual accepted %d", v);
@@ -98,17 +98,17 @@ void __cdecl rsa_notify(HANDLE context, int state)
return;
case -1: // сессия разорвана по ошибке, неверный тип сообщения
- msg = sim501; break;
+ msg = LPGEN("Session closed by receiving incorrect message type"); break;
case -2: // сессия разорвана по ошибке другой стороной
- msg = sim502; break;
+ msg = LPGEN("Session closed by other side on error"); break;
case -5: // ошибка декодирования AES сообщения
- msg = sim505; break;
+ msg = LPGEN("Error while decoding AES message"); break;
case -6: // ошибка декодирования RSA сообщения
- msg = sim506; break;
+ msg = LPGEN("Error while decoding RSA message"); break;
case -7: // таймаут установки соединения (10 секунд)
- msg = sim507; break;
+ msg = LPGEN("Session closed on timeout"); break;
case -8: // сессия разорвана по причине "disabled"
- msg = sim508; break;
+ msg = LPGEN("Session closed by other side when status \"disabled\""); break;
case -0x10: // сессия разорвана по ошибке
case -0x21:
case -0x22:
@@ -122,7 +122,7 @@ void __cdecl rsa_notify(HANDLE context, int state)
case -0x60:
{
char buf[1024];
- mir_snprintf(buf, sim510, -state);
+ mir_snprintf(buf, LPGEN("Session closed on error: %02x"), -state);
showPopupDCmsg(ptr->hContact, buf);
ShowStatusIconNotify(ptr->hContact);
if (ptr->cntx) deleteRSAcntx(ptr);