summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt/src
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/WhenWasIt/src
parent3216d8df5cb355f34c82ed10b7e40bab7525b697 (diff)
GetContactProto: useless duplicate function replaced with standard Proto_GetBaseAccountName
Diffstat (limited to 'plugins/WhenWasIt/src')
-rw-r--r--plugins/WhenWasIt/src/date_utils.cpp6
-rw-r--r--plugins/WhenWasIt/src/dlg_handlers.cpp4
-rw-r--r--plugins/WhenWasIt/src/services.cpp2
-rw-r--r--plugins/WhenWasIt/src/utils.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/plugins/WhenWasIt/src/date_utils.cpp b/plugins/WhenWasIt/src/date_utils.cpp
index 325f5dc895..96da0e9436 100644
--- a/plugins/WhenWasIt/src/date_utils.cpp
+++ b/plugins/WhenWasIt/src/date_utils.cpp
@@ -41,7 +41,7 @@ int GetContactDOB(MCONTACT hContact, int &year, int &month, int &day)
if (IsDOBValid(year, month, day))
return DOB_USERINFO;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
year = db_get_w(hContact, szProto, "BirthYear", 0);
month = db_get_b(hContact, szProto, "BirthMonth", 0);
day = db_get_b(hContact, szProto, "BirthDay", 0);
@@ -86,7 +86,7 @@ char GetContactGender(MCONTACT hContact)
{
char gender = db_get_b(hContact, "UserInfo", "Gender", 'U');
if (gender == 'U')
- gender = db_get_b(hContact, GetContactProto(hContact), "Gender", 'U');
+ gender = db_get_b(hContact, Proto_GetBaseAccountName(hContact), "Gender", 'U');
return gender;
}
@@ -194,7 +194,7 @@ int SaveBirthday(MCONTACT hContact, int year, int month, int day, int mode)
char *sYear, *sdYear, *sd2Year;
char *sMonth, *sdMonth, *sd2Month;
char *sDay, *sdDay, *sd2Day;
- char *protocol = GetContactProto(hContact);
+ char *protocol = Proto_GetBaseAccountName(hContact);
switch (mode) {
case SAVE_MODE_MBIRTHDAY:
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp
index 0ce375b103..3e16ad0eeb 100644
--- a/plugins/WhenWasIt/src/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/src/dlg_handlers.cpp
@@ -408,7 +408,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
{
wchar_t *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
wchar_t *szCurrentModuleTooltip = nullptr;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
wchar_t buffer[2048];
mir_snwprintf(buffer, TranslateT("Set birthday for %s:"), Clist_GetContactDisplayName(hContact));
@@ -584,7 +584,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll,
if (month > currentMonth || (month == currentMonth) && (day > currentDay)) // birthday still to come
age--;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
PROTOACCOUNT *pAcc = Proto_GetAccount(szProto);
wchar_t *ptszAccName = (pAcc == nullptr) ? TranslateT("Unknown") : pAcc->tszAccountName;
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index e0f459d225..9c3770f100 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -303,7 +303,7 @@ int DoExport(wchar_t *fileName)
int year, month, day;
GetContactDOB(hContact, year, month, day);
if (IsDOBValid(year, month, day)) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
wchar_t *szHandle = GetContactID(hContact, szProto);
if ((szHandle) && (mir_strlen(szProto) > 0))
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp
index 4b6240ae69..9a5cd03e16 100644
--- a/plugins/WhenWasIt/src/utils.cpp
+++ b/plugins/WhenWasIt/src/utils.cpp
@@ -152,7 +152,7 @@ wchar_t* GetContactID(MCONTACT hContact, char *szProto)
MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
{
for (auto &hContact : Contacts()) {
- char *m_szProto = GetContactProto(hContact);
+ char *m_szProto = Proto_GetBaseAccountName(hContact);
wchar_t *szHandle = GetContactID(hContact, szProto);
if (szHandle) {
bool found = (!mir_wstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));