diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-18 17:21:08 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-18 17:21:08 +0000 |
commit | a1d6cb7bdc354be0968c6ba5ac4615e14a90eead (patch) | |
tree | a1ed17002c33644b3362e6c1e6572f3fa7ef17d7 /src | |
parent | fef6b799309b5b9d7cbb2845fa27b777477e2a61 (diff) |
these tons of code aren't needed anymore...
git-svn-id: http://svn.miranda-ng.org/main/trunk@16850 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdauth/src/auth.cpp | 23 | ||||
-rw-r--r-- | src/core/stdfile/src/file.cpp | 20 | ||||
-rw-r--r-- | src/core/stdfile/src/filerecvdlg.cpp | 30 | ||||
-rw-r--r-- | src/core/stdfile/src/filesenddlg.cpp | 30 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 49 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 32 | ||||
-rw-r--r-- | src/mir_app/src/clistsettings.cpp | 26 | ||||
-rw-r--r-- | src/mir_app/src/contacts.cpp | 356 | ||||
-rw-r--r-- | src/mir_app/src/meta_utils.cpp | 30 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/path.cpp | 21 | ||||
-rw-r--r-- | src/mir_app/src/proto_opts.cpp | 26 |
13 files changed, 176 insertions, 469 deletions
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index adb4577ab3..da81b55068 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -44,7 +44,6 @@ INT_PTR ShowAddedWindow(WPARAM, LPARAM lParam) static int AuthEventAdded(WPARAM, LPARAM lParam)
{
- TCHAR szUid[128] = _T("");
TCHAR szTooltip[256];
MEVENT hDbEvent = (MEVENT)lParam;
@@ -66,27 +65,11 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) cli.lParam = lParam;
cli.hDbEvent = hDbEvent;
- CONTACTINFO ci = {};
- ci.cbSize = sizeof(ci);
- ci.hContact = hContact;
- ci.szProto = GetContactProto(hContact);
- ci.dwFlag = CNF_UNIQUEID | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- _tcsncpy_s(szUid, ci.pszVal, _TRUNCATE);
- mir_free(ci.pszVal);
- break;
-
- case CNFT_DWORD:
- mir_sntprintf(szUid, _T("%u"), ci.dVal);
- break;
- }
- }
+ ptrT szUid(Contact_GetInfo(CNF_UNIQUEID, hContact));
if (dbei.eventType == EVENTTYPE_AUTHREQUEST) {
SkinPlaySound("AuthRequest");
- if (szUid[0])
+ if (szUid)
mir_sntprintf(szTooltip, TranslateT("%s requests authorization"), szUid);
else
mir_sntprintf(szTooltip, TranslateT("%u requests authorization"), *(PDWORD)dbei.pBlob);
@@ -97,7 +80,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) }
else if (dbei.eventType == EVENTTYPE_ADDED) {
SkinPlaySound("AddedEvent");
- if (szUid[0])
+ if (szUid)
mir_sntprintf(szTooltip, TranslateT("%s added you to their contact list"), szUid);
else
mir_sntprintf(szTooltip, TranslateT("%u added you to their contact list"), *(PDWORD)dbei.pBlob);
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 33d6a5df66..2e6409bbfd 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -35,25 +35,11 @@ static HGENMENU hSRFileMenuItem; TCHAR* GetContactID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
- if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1) {
+ if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
if (TCHAR *theValue = db_get_tsa(hContact, szProto, "ChatRoomID"))
return theValue;
- }
- else {
- CONTACTINFO ci = { sizeof(ci) };
- ci.hContact = hContact;
- ci.szProto = szProto;
- ci.dwFlag = CNF_UNIQUEID | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- return (TCHAR*)ci.pszVal;
- case CNFT_DWORD:
- return _itot(ci.dVal, (TCHAR*)mir_alloc(sizeof(TCHAR)*32), 10);
- }
- }
- }
- return NULL;
+
+ return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
}
static INT_PTR SendFileCommand(WPARAM hContact, LPARAM)
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index df3d46f881..47254f5499 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -247,34 +247,8 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TimeZone_PrintTimeStamp(NULL, dbei.timestamp, _T("t d"), datetimestr, _countof(datetimestr), 0);
SetDlgItemText(hwndDlg, IDC_DATE, datetimestr);
- char* szProto = GetContactProto(dat->hContact);
- if (szProto) {
- int hasName = 0;
- char buf[128];
-
- CONTACTINFO ci = { 0 };
- ci.cbSize = sizeof(ci);
- ci.hContact = dat->hContact;
- ci.szProto = szProto;
- ci.dwFlag = CNF_UNIQUEID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- hasName = 1;
- strncpy_s(buf, (char*)ci.pszVal, _TRUNCATE);
- mir_free(ci.pszVal);
- break;
- case CNFT_DWORD:
- hasName = 1;
- mir_snprintf(buf, "%u", ci.dVal);
- break;
- }
- }
- if (hasName)
- SetDlgItemTextA(hwndDlg, IDC_NAME, buf);
- else
- SetDlgItemText(hwndDlg, IDC_NAME, contactName);
- }
+ ptrT info(Contact_GetInfo(CNF_UNIQUEID, dat->hContact));
+ SetDlgItemText(hwndDlg, IDC_NAME, (info) ? info : contactName);
if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) {
RECT rcBtn1, rcBtn2, rcDateCtrl;
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index a2aa180770..2a5d28c7ef 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -238,34 +238,8 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_TO, contactName);
- char *szProto = GetContactProto(dat->hContact);
- if (szProto) {
- int hasName = 0;
- char buf[128];
-
- CONTACTINFO ci = { sizeof(ci) };
- ci.hContact = dat->hContact;
- ci.szProto = szProto;
- ci.dwFlag = CNF_UNIQUEID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- hasName = 1;
- strncpy_s(buf, (char*)ci.pszVal, _TRUNCATE);
- mir_free(ci.pszVal);
- break;
- case CNFT_DWORD:
- hasName = 1;
- mir_snprintf(buf, "%u", ci.dVal);
- break;
- }
- }
-
- if (hasName)
- SetDlgItemTextA(hwndDlg, IDC_NAME, buf);
- else
- SetDlgItemText(hwndDlg, IDC_NAME, contactName);
- }
+ ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact));
+ SetDlgItemText(hwndDlg, IDC_NAME, (id) ? id : contactName);
if (fsd->ppFiles == NULL) {
EnableWindow(hwndDlg, FALSE);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index cd941d301c..22bf436713 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -920,27 +920,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case DM_USERNAMETOCLIP:
if (dat->hContact) {
- TCHAR buf[128] = _T("");
- CONTACTINFO ci = { sizeof(ci) };
- ci.hContact = dat->hContact;
- ci.szProto = dat->szProto;
- ci.dwFlag = CNF_UNIQUEID | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- _tcsncpy_s(buf, ci.pszVal, _TRUNCATE);
- mir_free(ci.pszVal);
- break;
-
- case CNFT_DWORD:
- mir_sntprintf(buf, _T("%u"), ci.dVal);
- break;
- }
- }
- if (buf[0] && OpenClipboard(hwndDlg)) {
+ ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto));
+ if (id != NULL && OpenClipboard(hwndDlg)) {
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(buf) * sizeof(TCHAR)+1);
- mir_tstrcpy((TCHAR*)GlobalLock(hData), buf);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(id) * sizeof(TCHAR)+1);
+ mir_tstrcpy((TCHAR*)GlobalLock(hData), id);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -1025,29 +1009,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
- TCHAR buf[128] = _T("");
- if (mir_strcmp(dat->szProto, META_PROTO)) {
- CONTACTINFO ci = { 0 };
- ci.cbSize = sizeof(ci);
- ci.hContact = dat->hContact;
- ci.szProto = dat->szProto;
- ci.dwFlag = CNF_DISPLAYUID | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- _tcsncpy_s(buf, ci.pszVal, _TRUNCATE);
- mir_free(ci.pszVal);
- break;
- case CNFT_DWORD:
- mir_sntprintf(buf, _T("%u"), ci.dVal);
- break;
- }
- }
- }
- if (buf[0])
- SetDlgItemText(hwndDlg, IDC_NAME, buf);
- else
- SetDlgItemText(hwndDlg, IDC_NAME, contactName);
+ ptrT id(Contact_GetInfo(CNF_DISPLAYUID, dat->hContact, dat->szProto));
+ SetDlgItemText(hwndDlg, IDC_NAME, (id) ? id : contactName);
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0);
if (statusIcon)
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 29ab6af1f9..38e583c2ca 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -271,27 +271,18 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT if (!(g_dat.flags & SMF_HIDENAMES) && dbei.eventType != EVENTTYPE_JABBER_CHATSTATES && dbei.eventType != EVENTTYPE_JABBER_PRESENCE) {
TCHAR *szName;
- CONTACTINFO ci = { 0 };
if (dbei.flags & DBEF_SENT) {
- ci.cbSize = sizeof(ci);
- ci.szProto = dbei.szModule;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
- // CNF_DISPLAY always returns a string type
- szName = ci.pszVal;
- }
+ if (TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule))
+ szName = NEWTSTR_ALLOCA(p);
else
- // Shouldn't happen?
- szName = mir_tstrdup(TranslateT("Me"));
+ szName = TranslateT("Me");
}
else szName = pcli->pfnGetContactDisplayName(hContact, 0);
buffer.AppendFormat(" %s ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME));
AppendToBufferWithRTF(buffer, szName);
showColon = 1;
- if (ci.pszVal)
- mir_free(ci.pszVal);
}
if (showColon)
@@ -302,18 +293,11 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT case EVENTTYPE_JABBER_CHATSTATES:
case EVENTTYPE_JABBER_PRESENCE:
if (dbei.flags & DBEF_SENT) {
- CONTACTINFO ci = { sizeof(ci) };
- ci.hContact = NULL;
- ci.szProto = dbei.szModule;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
-
- // CNF_DISPLAY always returns a string type
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci))
- szName = NEWTSTR_ALLOCA(ci.pszVal);
- else
- szName = _T("");
-
- mir_free(ci.pszVal);
+ if (TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule)) {
+ szName = NEWTSTR_ALLOCA(p);
+ mir_free(p);
+ }
+ else szName = _T("");
}
else szName = pcli->pfnGetContactDisplayName(hContact, 0);
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index b74bd28139..9f2b8f6593 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -109,27 +109,11 @@ TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode) return cacheEntry->tszName;
}
- CONTACTINFO ci;
- memset(&ci, 0, sizeof(ci));
- ci.cbSize = sizeof(ci);
- ci.hContact = hContact;
- if (ci.hContact == NULL)
- ci.szProto = "ICQ";
- ci.dwFlag = ((mode == GCDNF_NOMYHANDLE) ? CNF_DISPLAYNC : CNF_DISPLAY) | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
- if (ci.type == CNFT_ASCIIZ) {
- if (cacheEntry != NULL)
- replaceStrT(cacheEntry->tszName, ci.pszVal);
- return ci.pszVal;
- }
-
- if (ci.type == CNFT_DWORD) {
- TCHAR *buffer = (TCHAR*)mir_alloc(15 * sizeof(TCHAR));
- _ltot(ci.dVal, buffer, 10);
- if (cacheEntry != NULL)
- replaceStrT(cacheEntry->tszName, buffer);
- return buffer;
- }
+ ptrT tszDisplayName(Contact_GetInfo((mode == GCDNF_NOMYHANDLE) ? CNF_DISPLAYNC : CNF_DISPLAY, hContact));
+ if (tszDisplayName != NULL) {
+ if (cacheEntry != NULL)
+ replaceStrT(cacheEntry->tszName, tszDisplayName);
+ return tszDisplayName.detach();
}
CallContactService(hContact, PSS_GETINFO, SGIF_MINIMAL, 0);
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 652cde3a4c..e2c679dcc3 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -40,198 +40,159 @@ static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] = BYTE nameOrder[NAMEORDERCOUNT];
-static int GetDatabaseString(CONTACTINFO *ci, const char* setting, DBVARIANT* dbv)
+static int GetDatabaseString(MCONTACT hContact, const char *szProto, const char *szSetting, DBVARIANT *dbv)
{
- if (mir_strcmp(ci->szProto, "CList") && CallProtoService(ci->szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) {
- DBCONTACTGETSETTING cgs = { ci->szProto, setting, dbv };
- dbv->type = (ci->dwFlag & CNF_UNICODE) ? DBVT_WCHAR : DBVT_ASCIIZ;
+ if (mir_strcmp(szProto, "CList") && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) {
+ DBCONTACTGETSETTING cgs = { szProto, szSetting, dbv };
+ dbv->type = DBVT_WCHAR;
- int res = CallProtoService(ci->szProto, PS_GETINFOSETTING, (WPARAM)ci->hContact, (LPARAM)&cgs);
+ int res = CallProtoService(szProto, PS_GETINFOSETTING, (WPARAM)hContact, (LPARAM)&cgs);
if (res != CALLSERVICE_NOTFOUND)
return res;
}
- if (ci->dwFlag & CNF_UNICODE)
- return db_get_ws(ci->hContact, ci->szProto, setting, dbv);
-
- return db_get_s(ci->hContact, ci->szProto, setting, dbv);
+ return db_get_ws(hContact, szProto, szSetting, dbv);
}
-static int ProcessDatabaseValueDefault(CONTACTINFO *ci, const char* setting)
+static TCHAR* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto, const char *szSetting)
{
DBVARIANT dbv;
- if (!GetDatabaseString(ci, setting, &dbv)) {
+ if (!GetDatabaseString(hContact, szProto, szSetting, &dbv)) {
switch (dbv.type) {
case DBVT_ASCIIZ:
if (!dbv.pszVal[0]) break;
case DBVT_WCHAR:
if (!dbv.pwszVal[0]) break;
- ci->type = CNFT_ASCIIZ;
- ci->pszVal = dbv.ptszVal;
- return 0;
+ return dbv.ptszVal;
}
db_free(&dbv);
}
- if (db_get(ci->hContact, ci->szProto, setting, &dbv))
- return 1;
+ if (db_get(hContact, szProto, szSetting, &dbv))
+ return NULL;
+ TCHAR buf[40];
switch (dbv.type) {
case DBVT_BYTE:
- ci->type = CNFT_BYTE;
- ci->bVal = dbv.bVal;
- return 0;
+ return mir_tstrdup(_itot(dbv.bVal, buf, 10));
case DBVT_WORD:
- ci->type = CNFT_WORD;
- ci->wVal = dbv.wVal;
- return 0;
+ return mir_tstrdup(_itot(dbv.wVal, buf, 10));
case DBVT_DWORD:
- ci->type = CNFT_DWORD;
- ci->dVal = dbv.dVal;
- return 0;
+ return mir_tstrdup(_itot(dbv.dVal, buf, 10));
}
db_free(&dbv);
- return 1;
+ return NULL;
}
-static INT_PTR GetContactInfo(WPARAM, LPARAM lParam)
+MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szProto)
{
+ if (szProto == NULL)
+ szProto = Proto_GetBaseAccountName(hContact);
+ if (szProto == NULL)
+ return NULL;
+
+ char *uid;
+ TCHAR *res;
DBVARIANT dbv;
- CONTACTINFO *ci = (CONTACTINFO*)lParam;
- if (ci == NULL) return 1;
- if (ci->szProto == NULL) ci->szProto = Proto_GetBaseAccountName(ci->hContact);
- if (ci->szProto == NULL) return 1;
-
- ci->type = 0;
- switch (ci->dwFlag & 0x7F) {
- case CNF_FIRSTNAME: return ProcessDatabaseValueDefault(ci, "FirstName");
- case CNF_LASTNAME: return ProcessDatabaseValueDefault(ci, "LastName");
- case CNF_NICK: return ProcessDatabaseValueDefault(ci, "Nick");
- case CNF_EMAIL: return ProcessDatabaseValueDefault(ci, "e-mail");
- case CNF_CITY: return ProcessDatabaseValueDefault(ci, "City");
- case CNF_STATE: return ProcessDatabaseValueDefault(ci, "State");
- case CNF_PHONE: return ProcessDatabaseValueDefault(ci, "Phone");
- case CNF_HOMEPAGE: return ProcessDatabaseValueDefault(ci, "Homepage");
- case CNF_ABOUT: return ProcessDatabaseValueDefault(ci, "About");
- case CNF_AGE: return ProcessDatabaseValueDefault(ci, "Age");
- case CNF_GENDER: return ProcessDatabaseValueDefault(ci, "Gender");
- case CNF_FAX: return ProcessDatabaseValueDefault(ci, "Fax");
- case CNF_CELLULAR: return ProcessDatabaseValueDefault(ci, "Cellular");
- case CNF_BIRTHDAY: return ProcessDatabaseValueDefault(ci, "BirthDay");
- case CNF_BIRTHMONTH: return ProcessDatabaseValueDefault(ci, "BirthMonth");
- case CNF_BIRTHYEAR: return ProcessDatabaseValueDefault(ci, "BirthYear");
- case CNF_STREET: return ProcessDatabaseValueDefault(ci, "Street");
- case CNF_ZIP: return ProcessDatabaseValueDefault(ci, "ZIP");
- case CNF_LANGUAGE1: return ProcessDatabaseValueDefault(ci, "Language1");
- case CNF_LANGUAGE2: return ProcessDatabaseValueDefault(ci, "Language2");
- case CNF_LANGUAGE3: return ProcessDatabaseValueDefault(ci, "Language3");
- case CNF_CONAME: return ProcessDatabaseValueDefault(ci, "Company");
- case CNF_CODEPT: return ProcessDatabaseValueDefault(ci, "CompanyDepartment");
- case CNF_COPOSITION: return ProcessDatabaseValueDefault(ci, "CompanyPosition");
- case CNF_COSTREET: return ProcessDatabaseValueDefault(ci, "CompanyStreet");
- case CNF_COCITY: return ProcessDatabaseValueDefault(ci, "CompanyCity");
- case CNF_COSTATE: return ProcessDatabaseValueDefault(ci, "CompanyState");
- case CNF_COZIP: return ProcessDatabaseValueDefault(ci, "CompanyZIP");
- case CNF_COHOMEPAGE: return ProcessDatabaseValueDefault(ci, "CompanyHomepage");
+ switch (type) {
+ case CNF_FIRSTNAME: return ProcessDatabaseValueDefault(hContact, szProto, "FirstName");
+ case CNF_LASTNAME: return ProcessDatabaseValueDefault(hContact, szProto, "LastName");
+ case CNF_NICK: return ProcessDatabaseValueDefault(hContact, szProto, "Nick");
+ case CNF_EMAIL: return ProcessDatabaseValueDefault(hContact, szProto, "e-mail");
+ case CNF_CITY: return ProcessDatabaseValueDefault(hContact, szProto, "City");
+ case CNF_STATE: return ProcessDatabaseValueDefault(hContact, szProto, "State");
+ case CNF_PHONE: return ProcessDatabaseValueDefault(hContact, szProto, "Phone");
+ case CNF_HOMEPAGE: return ProcessDatabaseValueDefault(hContact, szProto, "Homepage");
+ case CNF_ABOUT: return ProcessDatabaseValueDefault(hContact, szProto, "About");
+ case CNF_AGE: return ProcessDatabaseValueDefault(hContact, szProto, "Age");
+ case CNF_GENDER: return ProcessDatabaseValueDefault(hContact, szProto, "Gender");
+ case CNF_FAX: return ProcessDatabaseValueDefault(hContact, szProto, "Fax");
+ case CNF_CELLULAR: return ProcessDatabaseValueDefault(hContact, szProto, "Cellular");
+ case CNF_BIRTHDAY: return ProcessDatabaseValueDefault(hContact, szProto, "BirthDay");
+ case CNF_BIRTHMONTH: return ProcessDatabaseValueDefault(hContact, szProto, "BirthMonth");
+ case CNF_BIRTHYEAR: return ProcessDatabaseValueDefault(hContact, szProto, "BirthYear");
+ case CNF_STREET: return ProcessDatabaseValueDefault(hContact, szProto, "Street");
+ case CNF_ZIP: return ProcessDatabaseValueDefault(hContact, szProto, "ZIP");
+ case CNF_LANGUAGE1: return ProcessDatabaseValueDefault(hContact, szProto, "Language1");
+ case CNF_LANGUAGE2: return ProcessDatabaseValueDefault(hContact, szProto, "Language2");
+ case CNF_LANGUAGE3: return ProcessDatabaseValueDefault(hContact, szProto, "Language3");
+ case CNF_CONAME: return ProcessDatabaseValueDefault(hContact, szProto, "Company");
+ case CNF_CODEPT: return ProcessDatabaseValueDefault(hContact, szProto, "CompanyDepartment");
+ case CNF_COPOSITION: return ProcessDatabaseValueDefault(hContact, szProto, "CompanyPosition");
+ case CNF_COSTREET: return ProcessDatabaseValueDefault(hContact, szProto, "CompanyStreet");
+ case CNF_COCITY: return ProcessDatabaseValueDefault(hContact, szProto, "CompanyCity");
+ case CNF_COSTATE: return ProcessDatabaseValueDefault(hContact, szProto, "CompanyState");
+ case CNF_COZIP: return ProcessDatabaseValueDefault(hContact, szProto, "CompanyZIP");
+ case CNF_COHOMEPAGE: return ProcessDatabaseValueDefault(hContact, szProto, "CompanyHomepage");
case CNF_CUSTOMNICK:
{
- char* saveProto = ci->szProto; ci->szProto = "CList";
- if (ci->hContact != NULL && !ProcessDatabaseValueDefault(ci, "MyHandle")) {
- ci->szProto = saveProto;
+ const char* saveProto = szProto; szProto = "CList";
+ if (hContact != NULL && !ProcessDatabaseValueDefault(hContact, szProto, "MyHandle")) {
+ szProto = saveProto;
return 0;
}
- ci->szProto = saveProto;
+ szProto = saveProto;
}
break;
case CNF_COUNTRY:
case CNF_COCOUNTRY:
- if (!GetDatabaseString(ci, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "CountryName" : "CompanyCountryName", &dbv))
- return 0;
+ if (!GetDatabaseString(hContact, szProto, type == CNF_COUNTRY ? "CountryName" : "CompanyCountryName", &dbv))
+ return dbv.ptszVal;
- if (!db_get(ci->hContact, ci->szProto, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
+ if (!db_get(hContact, szProto, type == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
if (dbv.type == DBVT_WORD) {
- int i, countryCount;
+ int countryCount;
struct CountryListEntry *countries;
CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&countryCount, (LPARAM)&countries);
- for (i = 0; i < countryCount; i++) {
- if (countries[i].id != dbv.wVal) continue;
-
- if (ci->dwFlag & CNF_UNICODE) {
- int cbLen = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)countries[i].szName, -1, NULL, 0);
- WCHAR* buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*(cbLen + 1));
- if (buf != NULL)
- MultiByteToWideChar(CP_ACP, 0, (LPCSTR)countries[i].szName, -1, buf, cbLen);
- ci->pszVal = (TCHAR*)buf;
- }
- else ci->pszVal = (TCHAR*)mir_strdup(countries[i].szName);
-
- ci->type = CNFT_ASCIIZ;
- db_free(&dbv);
- return 0;
- }
+ for (int i = 0; i < countryCount; i++)
+ if (countries[i].id == dbv.wVal)
+ return mir_a2t(countries[i].szName);
+ }
+ else {
+ db_free(&dbv);
+ return ProcessDatabaseValueDefault(hContact, szProto, type == CNF_COUNTRY ? "Country" : "CompanyCountry");
}
- else return ProcessDatabaseValueDefault(ci, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry");
- db_free(&dbv);
}
break;
case CNF_FIRSTLAST:
- if (!GetDatabaseString(ci, "FirstName", &dbv)) {
+ if (!GetDatabaseString(hContact, szProto, "FirstName", &dbv)) {
DBVARIANT dbv2;
- if (!GetDatabaseString(ci, "LastName", &dbv2)) {
- ci->type = CNFT_ASCIIZ;
- if (ci->dwFlag & CNF_UNICODE) {
- size_t len = mir_wstrlen(dbv.pwszVal) + mir_wstrlen(dbv2.pwszVal) + 2;
- WCHAR* buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
- if (buf != NULL)
- mir_wstrcat(mir_wstrcat(mir_wstrcpy(buf, dbv.pwszVal), L" "), dbv2.pwszVal);
- ci->pszVal = (TCHAR*)buf;
- }
- else {
- size_t len = mir_strlen(dbv.pszVal) + mir_strlen(dbv2.pszVal) + 2;
- char* buf = (char*)mir_alloc(len);
- if (buf != NULL)
- mir_strcat(mir_strcat(mir_strcpy(buf, dbv.pszVal), " "), dbv2.pszVal);
- ci->pszVal = (TCHAR*)buf;
- }
+ if (!GetDatabaseString(hContact, szProto, "LastName", &dbv2)) {
+ size_t len = mir_wstrlen(dbv.pwszVal) + mir_wstrlen(dbv2.pwszVal) + 2;
+ WCHAR* buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
+ if (buf != NULL)
+ mir_wstrcat(mir_wstrcat(mir_wstrcpy(buf, dbv.pwszVal), L" "), dbv2.pwszVal);
db_free(&dbv);
db_free(&dbv2);
- return 0;
+ return buf;
}
db_free(&dbv);
}
break;
case CNF_UNIQUEID:
- {
- if (db_mc_isMeta(ci->hContact)) {
- TCHAR buf[40];
- _itot(ci->hContact, buf, 10);
- ci->pszVal = mir_tstrdup(buf);
- ci->type = CNFT_ASCIIZ;
- return 0;
- }
-
- char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
- if (!ProcessDatabaseValueDefault(ci, uid))
- return 0;
+ if (db_mc_isMeta(hContact)) {
+ TCHAR buf[40];
+ _itot(hContact, buf, 10);
+ return mir_tstrdup(buf);
}
+
+ uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
+ return ProcessDatabaseValueDefault(hContact, szProto, uid);
break;
case CNF_DISPLAYUID:
- {
- if (!ProcessDatabaseValueDefault(ci, "display_uid"))
- return 0;
- char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
- if (!ProcessDatabaseValueDefault(ci, uid))
- return 0;
-
- }
+ if (res = ProcessDatabaseValueDefault(hContact, szProto, "display_uid"))
+ return res;
+
+ uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
+ return ProcessDatabaseValueDefault(hContact, szProto, uid);
break;
case CNF_DISPLAYNC:
@@ -241,134 +202,84 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) case 0: // custom name
// make sure we aren't in CNF_DISPLAYNC mode
// don't get custom name for NULL contact
- {
- char *saveProto = ci->szProto; ci->szProto = "CList";
- if (ci->hContact != NULL && (ci->dwFlag & 0x7F) == CNF_DISPLAY && !ProcessDatabaseValueDefault(ci, "MyHandle")) {
- ci->szProto = saveProto;
- return 0;
- }
- ci->szProto = saveProto;
- }
+ if (hContact != NULL && type == CNF_DISPLAY && (res = ProcessDatabaseValueDefault(hContact, "CList", "MyHandle")) != NULL)
+ return res;
break;
+
case 1:
- if (!ProcessDatabaseValueDefault(ci, "Nick")) // nick
- return 0;
+ if (res = ProcessDatabaseValueDefault(hContact, szProto, "Nick")) // nick
+ return res;
break;
case 2:
- if (!ProcessDatabaseValueDefault(ci, "FirstName")) // First Name
- return 0;
+ if (res = ProcessDatabaseValueDefault(hContact, szProto, "FirstName")) // First Name
+ return res;
break;
case 3:
- if (!ProcessDatabaseValueDefault(ci, "e-mail")) // E-mail
- return 0;
+ if (res = ProcessDatabaseValueDefault(hContact, szProto, "e-mail")) // E-mail
+ return res;
break;
case 4:
- if (!ProcessDatabaseValueDefault(ci, "LastName")) // Last Name
- return 0;
+ if (res = ProcessDatabaseValueDefault(hContact, szProto, "LastName")) // Last Name
+ return res;
break;
+
case 5: // Unique id
- {
- // protocol must define a PFLAG_UNIQUEIDSETTING
- char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid) {
- if (!GetDatabaseString(ci, uid, &dbv)) {
- if (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD) {
- long value = (dbv.type == DBVT_BYTE) ? dbv.bVal : (dbv.type == DBVT_WORD ? dbv.wVal : dbv.dVal);
- if (ci->dwFlag & CNF_UNICODE) {
- WCHAR buf[40];
- _ltow(value, buf, 10);
- ci->pszVal = (TCHAR*)mir_wstrdup(buf);
- }
- else {
- char buf[40];
- _ltoa(value, buf, 10);
- ci->pszVal = (TCHAR*)mir_strdup(buf);
- }
- ci->type = CNFT_ASCIIZ;
- return 0;
- }
- if (dbv.type == DBVT_ASCIIZ && !(ci->dwFlag & CNF_UNICODE)) {
- ci->type = CNFT_ASCIIZ;
- ci->pszVal = dbv.ptszVal;
- return 0;
- }
- if (dbv.type == DBVT_WCHAR && (ci->dwFlag & CNF_UNICODE)) {
- ci->type = CNFT_ASCIIZ;
- ci->pszVal = dbv.ptszVal;
- return 0;
- }
+ // protocol must define a PFLAG_UNIQUEIDSETTING
+ uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid) {
+ if (!GetDatabaseString(hContact, szProto, uid, &dbv)) {
+ if (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD) {
+ long value = (dbv.type == DBVT_BYTE) ? dbv.bVal : (dbv.type == DBVT_WORD ? dbv.wVal : dbv.dVal);
+ WCHAR buf[40];
+ _ltow(value, buf, 10);
+ return mir_wstrdup(buf);
}
+ return dbv.ptszVal;
}
}
break;
+
case 6: // first + last name
case 7: // last + first name
- if (!GetDatabaseString(ci, nameOrder[i] == 6 ? "FirstName" : "LastName", &dbv)) {
+ if (!GetDatabaseString(hContact, szProto, nameOrder[i] == 6 ? "FirstName" : "LastName", &dbv)) {
DBVARIANT dbv2;
- if (!GetDatabaseString(ci, nameOrder[i] == 6 ? "LastName" : "FirstName", &dbv2)) {
- ci->type = CNFT_ASCIIZ;
-
- if (ci->dwFlag & CNF_UNICODE) {
- size_t len = mir_wstrlen(dbv.pwszVal) + mir_wstrlen(dbv2.pwszVal) + 2;
- WCHAR* buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
- if (buf != NULL)
- mir_wstrcat(mir_wstrcat(mir_wstrcpy(buf, dbv.pwszVal), L" "), dbv2.pwszVal);
- ci->pszVal = (TCHAR*)buf;
- }
- else {
- size_t len = mir_strlen(dbv.pszVal) + mir_strlen(dbv2.pszVal) + 2;
- char* buf = (char*)mir_alloc(len);
- if (buf != NULL)
- mir_strcat(mir_strcat(mir_strcpy(buf, dbv.pszVal), " "), dbv2.pszVal);
- ci->pszVal = (TCHAR*)buf;
- }
+ if (!GetDatabaseString(hContact, szProto, nameOrder[i] == 6 ? "LastName" : "FirstName", &dbv2)) {
+ size_t len = mir_wstrlen(dbv.pwszVal) + mir_wstrlen(dbv2.pwszVal) + 2;
+ WCHAR* buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
+ if (buf != NULL)
+ mir_wstrcat(mir_wstrcat(mir_wstrcpy(buf, dbv.pwszVal), L" "), dbv2.pwszVal);
db_free(&dbv);
db_free(&dbv2);
- return 0;
+ return buf;
}
db_free(&dbv);
}
break;
case 8:
- if (ci->dwFlag & CNF_UNICODE)
- ci->pszVal = (TCHAR*)mir_wstrdup(TranslateW(L"'(Unknown contact)'"));
- else
- ci->pszVal = (TCHAR*)mir_strdup(Translate("'(Unknown contact)'"));
- ci->type = CNFT_ASCIIZ;
- return 0;
- }
- }
- break;
-
- case CNF_TIMEZONE:
- {
- HANDLE hTz = TimeZone_CreateByContact(ci->hContact, 0, TZF_KNOWNONLY);
- if (hTz) {
- LPTIME_ZONE_INFORMATION tzi = TimeZone_GetInfo(hTz);
- int offset = tzi->Bias + tzi->StandardBias;
-
- char str[80];
- mir_snprintf(str, offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
- ci->pszVal = ci->dwFlag & CNF_UNICODE ? (TCHAR*)mir_a2u(str) : (TCHAR*)mir_strdup(str);
- ci->type = CNFT_ASCIIZ;
- return 0;
+ return mir_tstrdup(TranslateT("'(Unknown contact)'"));
}
}
break;
case CNF_MYNOTES:
- char* saveProto = ci->szProto; ci->szProto = "UserInfo";
- if (!ProcessDatabaseValueDefault(ci, "MyNotes")) {
- ci->szProto = saveProto;
- return 0;
+ return ProcessDatabaseValueDefault(hContact, "UserInfo", "MyNotes");
+
+ case CNF_TIMEZONE:
+ HANDLE hTz = TimeZone_CreateByContact(hContact, 0, TZF_KNOWNONLY);
+ if (hTz) {
+ LPTIME_ZONE_INFORMATION tzi = TimeZone_GetInfo(hTz);
+ int offset = tzi->Bias + tzi->StandardBias;
+
+ char str[80];
+ mir_snprintf(str, offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
+ return mir_a2u(str);
}
- ci->szProto = saveProto;
break;
}
- return 1;
+ return NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -446,7 +357,6 @@ int LoadContactsModule(void) db_free(&dbv);
}
- CreateServiceFunction(MS_CONTACT_GETCONTACTINFO, GetContactInfo);
HookEvent(ME_OPT_INITIALISE, ContactOptInit);
return 0;
}
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 838faace9b..a8499971a4 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -40,35 +40,11 @@ POINT menuMousePoint; int Meta_SetNick(char *szProto)
{
- CONTACTINFO ci = { sizeof(ci) };
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- ci.szProto = szProto;
- if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
+ ptrT tszNick(Contact_GetInfo(CNF_DISPLAY, NULL, szProto));
+ if (tszNick == NULL)
return 1;
- switch (ci.type) {
- case CNFT_BYTE:
- if (db_set_b(NULL, META_PROTO, "Nick", ci.bVal))
- return 1;
- break;
- case CNFT_WORD:
- if (db_set_w(NULL, META_PROTO, "Nick", ci.wVal))
- return 1;
- break;
- case CNFT_DWORD:
- if (db_set_dw(NULL, META_PROTO, "Nick", ci.dVal))
- return 1;
- break;
- case CNFT_ASCIIZ:
- if (db_set_ts(NULL, META_PROTO, "Nick", ci.pszVal))
- return 1;
- mir_free(ci.pszVal);
- break;
- default:
- if (db_set_s(NULL, META_PROTO, "Nick", (char *)TranslateT("Sender")))
- return 1;
- break;
- }
+ db_set_ts(NULL, META_PROTO, "Nick", tszNick);
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index e142457c3c..83558a0ecf 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -259,3 +259,4 @@ Clist_GroupGetName @257 Clist_GroupRename @258
Clist_EndRebuild @259
Clist_GroupAdded @260
+Contact_GetInfo @261
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 6fd5286825..e4d27302d3 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -259,3 +259,4 @@ Clist_GroupGetName @257 Clist_GroupRename @258
Clist_EndRebuild @259
Clist_GroupAdded @260
+Contact_GetInfo @261
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index fd697684b6..64426f4e4e 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -35,25 +35,10 @@ static TCHAR tszAvatarRoot[MAX_PATH]; TCHAR* GetContactID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
- if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1) {
+ if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
return db_get_tsa(hContact, szProto, "ChatRoomID");
- }
- else {
- CONTACTINFO ci = {0};
- ci.cbSize = sizeof(ci);
- ci.hContact = hContact;
- ci.szProto = szProto;
- ci.dwFlag = CNF_UNIQUEID | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- return (TCHAR *)ci.pszVal;
- case CNFT_DWORD:
- return _itot(ci.dVal, (TCHAR *)mir_alloc(sizeof(TCHAR)*32), 10);
- }
- }
- return NULL;
- }
+
+ return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index f87add9875..f7a72e5d70 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -626,26 +626,12 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM if (acc->ppro && Proto_IsProtocolLoaded(acc->szProtoName)) {
char *szIdName = (char *)acc->ppro->GetCaps(PFLAG_UNIQUEIDTEXT, 0);
- TCHAR *tszIdName = szIdName ? mir_a2t(szIdName) : mir_tstrdup(TranslateT("Account ID"));
-
- CONTACTINFO ci = { 0 };
- ci.cbSize = sizeof(ci);
- ci.hContact = NULL;
- ci.szProto = acc->szModuleName;
- ci.dwFlag = CNF_UNIQUEID | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- mir_sntprintf(text, size, _T("%s: %s"), tszIdName, ci.pszVal);
- mir_free(ci.pszVal);
- break;
- case CNFT_DWORD:
- mir_sntprintf(text, size, _T("%s: %d"), tszIdName, ci.dVal);
- break;
- }
- }
- else mir_sntprintf(text, size, _T("%s: %s"), tszIdName, TranslateT("<unknown>"));
- mir_free(tszIdName);
+ ptrT tszIdName(szIdName ? mir_a2t(szIdName) : mir_tstrdup(TranslateT("Account ID")));
+ ptrT tszUniqueID(Contact_GetInfo(CNF_UNIQUEID, NULL, acc->szModuleName));
+ if (tszUniqueID != NULL)
+ mir_sntprintf(text, size, _T("%s: %s"), tszIdName, tszUniqueID);
+ else
+ mir_sntprintf(text, size, _T("%s: %s"), tszIdName, TranslateT("<unknown>"));
}
else mir_sntprintf(text, size, TranslateT("Protocol is not loaded."));
|