summaryrefslogtreecommitdiff
path: root/plugins/QuickMessages
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/QuickMessages')
-rw-r--r--plugins/QuickMessages/src/Utils.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp
index 7878317d5c..9067c7ac12 100644
--- a/plugins/QuickMessages/src/Utils.cpp
+++ b/plugins/QuickMessages/src/Utils.cpp
@@ -397,7 +397,6 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
TCHAR* p = NULL;
int NameLenght = 0;
TCHAR* ptszName = NULL;
- CONTACTINFO ci;
if (!_tcschr(ptszQValue, varstr))
return ptszQValue;
@@ -499,16 +498,10 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
i = -1;
break;
case 'F':
- memset(&ci, 0, sizeof(CONTACTINFO));
- ci.cbSize = sizeof(CONTACTINFO);
- ci.hContact = hContact;
- ci.dwFlag = CNF_FIRSTNAME | CNF_UNICODE;
- ci.szProto = GetContactProto(hContact);
-
- if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
+ ptszName = Contact_GetInfo(CNF_FIRSTNAME, hContact);
+ if (ptszName == NULL)
break;
- NameLenght = (int)mir_tstrlen(ci.pszVal);
- ptszName = ci.pszVal;
+ NameLenght = (int)mir_tstrlen(ptszName);
p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
if (!p) {
mir_free(ptszName);
@@ -531,16 +524,11 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
i = -1;
break;
case 'L':
- memset(&ci, 0, sizeof(CONTACTINFO));
- ci.cbSize = sizeof(CONTACTINFO);
- ci.hContact = hContact;
- ci.dwFlag = CNF_LASTNAME | CNF_UNICODE;
- ci.szProto = GetContactProto(hContact);
-
- if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
+ ptszName = Contact_GetInfo(CNF_LASTNAME, hContact);
+ if (ptszName == NULL)
break;
- NameLenght = (int)mir_tstrlen(ci.pszVal);
- ptszName = ci.pszVal;
+
+ NameLenght = (int)mir_tstrlen(ptszName);
p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
if (!p) {
mir_free(ptszName);