summaryrefslogtreecommitdiff
path: root/plugins/TipperYM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-12-04 16:08:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-12-04 16:08:03 +0300
commit3bb16e798cb51d5764aacbefd4edf26f52d8c4f0 (patch)
tree59dbb53fc9496d660ec2ef2846a4eab0f1720b88 /plugins/TipperYM
parent3216d8df5cb355f34c82ed10b7e40bab7525b697 (diff)
GetContactProto: useless duplicate function replaced with standard Proto_GetBaseAccountName
Diffstat (limited to 'plugins/TipperYM')
-rw-r--r--plugins/TipperYM/src/message_pump.cpp2
-rw-r--r--plugins/TipperYM/src/popwin.cpp6
-rw-r--r--plugins/TipperYM/src/subst.cpp22
3 files changed, 15 insertions, 15 deletions
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp
index 220b974f7f..fd851af172 100644
--- a/plugins/TipperYM/src/message_pump.cpp
+++ b/plugins/TipperYM/src/message_pump.cpp
@@ -50,7 +50,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex)
bool bNeedWait = false;
if (opt.bWaitForContent && IsContactTooltip(clcitex)) {
MCONTACT hContact = (DWORD_PTR)clcitex->hItem;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (!szProto) return false;
if (opt.bWaitForStatusMsg && !bStatusMsgReady) {
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index b322ea68d4..4b08036ac0 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -306,7 +306,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
wcsncpy_s(pwd->swzTitle, Clist_GetContactDisplayName(pwd->hContact), _TRUNCATE);
- char *szProto = GetContactProto(pwd->hContact);
+ char *szProto = Proto_GetBaseAccountName(pwd->hContact);
pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto);
// get extra icons
@@ -1035,7 +1035,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else pwd->rows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData)* (pwd->iRowCount + 1));
- char *szProto = GetContactProto(pwd->hContact);
+ char *szProto = Proto_GetBaseAccountName(pwd->hContact);
pwd->rows[pwd->iRowCount].swzLabel = mir_wstrdup(buff_label);
pwd->rows[pwd->iRowCount].swzValue = mir_wstrdup(buff);
@@ -1580,7 +1580,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
for (auto &hContact : Contacts()) {
if (g_plugin.getByte(hContact, "FavouriteContact")) {
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
if (proto == nullptr)
continue;
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 78ae3c6c55..790d2b9a32 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -65,7 +65,7 @@ bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di)
if (di.type == DIT_ALL)
return true;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
if (db_get_b(hContact, szProto, "ChatRoom", 0) != 0)
return di.type == DIT_CHATS;
@@ -140,7 +140,7 @@ void FormatTimestamp(DWORD ts, char *szFormat, wchar_t *buff, int bufflen)
bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen)
{
- char *tmpProto = (hContact ? GetContactProto(hContact) : szProto);
+ char *tmpProto = (hContact ? Proto_GetBaseAccountName(hContact) : szProto);
if (tmpProto) {
const char *szUid = Proto_GetUniqueId(tmpProto);
if (szUid)
@@ -211,7 +211,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact)
wchar_t *swzMsg = nullptr;
DBVARIANT dbv;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
if (!mir_strcmp(szProto, META_PROTO))
hContact = db_mc_getMostOnline(hContact);
@@ -254,7 +254,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
return Uid(hContact, nullptr, buff, bufflen);
if (!mir_wstrcmp(swzRawSpec, L"proto")) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
a2t(szProto, buff, bufflen);
return true;
@@ -280,7 +280,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
return true;
}
else if (!mir_wstrcmp(swzRawSpec, L"uidname")) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
return UidName(szProto, buff, bufflen);
}
else if (!mir_wstrcmp(swzRawSpec, L"status_msg")) {
@@ -356,7 +356,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
int iNumber = 1;
MCONTACT hTmpContact = hContact;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto && !mir_strcmp(szProto, META_PROTO)) {
iNumber = db_mc_getSubCount(hContact);
hTmpContact = db_mc_getSub(hContact, 0);
@@ -434,7 +434,7 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int
case DVT_DB:
return transFunc(hContact, ds.szModuleName, ds.szSettingName, buff, bufflen) != nullptr;
case DVT_PROTODB:
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
if (transFunc(hContact, szProto, ds.szSettingName, buff, bufflen) != nullptr)
return true;
@@ -452,7 +452,7 @@ bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, wchar_t *buff, int buff
if (szRawSpec[i] == '/') {
szRawSpec[i] = 0;
if (mir_strlen(szRawSpec) == 0) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
if (translations[0].transFunc(hContact, szProto, &szRawSpec[i + 1], buff, bufflen) != nullptr)
return true;
@@ -507,7 +507,7 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar
*p = 0;
p++;
if (*p) {
- char *cp = GetContactProto(hContact);
+ char *cp = Proto_GetBaseAccountName(hContact);
if (cp != nullptr) {
PROTOACCOUNT *acc = Proto_GetAccount(cp);
if (acc != nullptr) {
@@ -748,11 +748,11 @@ wchar_t* GetProtoExtraStatusMessage(char *szProto)
if (ServiceExists(MS_VARS_FORMATSTRING)) {
MCONTACT hContact = db_find_first();
- char *proto = GetContactProto(hContact);
+ char *proto = Proto_GetBaseAccountName(hContact);
while (!proto) {
hContact = db_find_next(hContact);
if (hContact)
- proto = GetContactProto(hContact);
+ proto = Proto_GetBaseAccountName(hContact);
else {
hContact = NULL;
break;