summaryrefslogtreecommitdiff
path: root/plugins/AddContactPlus
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-07-23 14:15:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-07-23 14:15:06 +0300
commitbc8768c453fade64f20ff18c24092a41f94993a0 (patch)
tree908a832615b7dab0ff09c70d1c70e39bf3ff247e /plugins/AddContactPlus
parentdb937fbda0117e8bec530e7deda7b94eea106e78 (diff)
fixes #2493 (Проблема с Юникодом в диалоге добавления контакта)
Diffstat (limited to 'plugins/AddContactPlus')
-rw-r--r--plugins/AddContactPlus/src/addcontact.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp
index 4967352196..4ecd537ee6 100644
--- a/plugins/AddContactPlus/src/addcontact.cpp
+++ b/plugins/AddContactPlus/src/addcontact.cpp
@@ -48,15 +48,11 @@ void AddContactDlgOpts(HWND hdlg, const char* szProto, BOOL bAuthOptsOnly = FALS
SetDlgItemText(hdlg, IDC_AUTHREQ, (flags & PF4_NOCUSTOMAUTH) ? L"" : TranslateT("Please authorize my request and add me to your contact list."));
- char* szUniqueId = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
- if (szUniqueId) {
- size_t cbLen = mir_strlen(szUniqueId) + 2;
- wchar_t* pszUniqueId = (wchar_t*)mir_alloc(cbLen * sizeof(wchar_t));
- mir_snwprintf(pszUniqueId, cbLen, L"%S:", szUniqueId);
- SetDlgItemText(hdlg, IDC_IDLABEL, pszUniqueId);
- mir_free(pszUniqueId);
- }
- else SetDlgItemText(hdlg, IDC_IDLABEL, TranslateT("Contact ID:"));
+ wchar_t *wszUniqueId = (wchar_t *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
+ if (wszUniqueId)
+ SetDlgItemText(hdlg, IDC_IDLABEL, CMStringW(wszUniqueId) + L":");
+ else
+ SetDlgItemText(hdlg, IDC_IDLABEL, TranslateT("Contact ID:"));
flags = (szProto) ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : 0;
if (flags & PF1_NUMERICUSERID) {