From 9e195db36b720ba2d796a883769b5ac34e1ad59b Mon Sep 17 00:00:00 2001 From: Vlad Mironov Date: Mon, 31 Mar 2014 05:04:49 +0000 Subject: Variables: added ability to get a own nickname for protocol. git-svn-id: http://svn.miranda-ng.org/main/trunk@8805 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/src/parse_miranda.cpp | 14 ++++++++++++++ plugins/Variables/src/parse_miranda.h | 1 + 2 files changed, 15 insertions(+) diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 30e48f5db5..5b9fffc976 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -436,6 +436,20 @@ static TCHAR* parseProtoInfo(ARGUMENTSINFO *ai) if (szText != NULL) szRes = _strdup(szText); } + else if (!_tcscmp(ai->targv[2], _T(STR_PINICK))) + { + CONTACTINFO ci; + + ci.cbSize = sizeof(CONTACTINFO); + ci.dwFlag = CNF_DISPLAY | CNF_UNICODE; + ci.hContact = NULL; + ci.szProto = szProto; + CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci); + + tszRes = mir_tstrdup(ci.pszVal); + + mir_free(ci.pszVal); + } mir_free(szProto); if (szRes == NULL && tszRes == NULL) return NULL; diff --git a/plugins/Variables/src/parse_miranda.h b/plugins/Variables/src/parse_miranda.h index 5dbb9368c2..851b3963df 100644 --- a/plugins/Variables/src/parse_miranda.h +++ b/plugins/Variables/src/parse_miranda.h @@ -42,6 +42,7 @@ #define STR_PINAME "name" #define STR_PIUIDTEXT "uidtext" #define STR_PIUIDSETTING "uidsetting" +#define STR_PINICK "nick" #define SEEN_MODULE "SeenModule" -- cgit v1.2.3