summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src/popwin.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-08-18 20:58:12 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-08-18 20:58:12 +0000
commitce782f801ada17e8d97c620b81d7701479d8e10d (patch)
tree2c9e4ced6998d5c81e28ce361302c0103b7f68f1 /plugins/TipperYM/src/popwin.cpp
parent1782bd501414d4e074c991fa0f7612d9896a29e8 (diff)
big workaround to use core gender icons in Tipper (fixes #444)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5737 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/src/popwin.cpp')
-rw-r--r--plugins/TipperYM/src/popwin.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 00dee77ce6..1d44524342 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -366,18 +366,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// gender icon
if (pwd->bIsIconVisible[3]) {
for (i = 0; opt.exIconsOrder[i] != 3; i++);
- if (ServiceExists(MS_GENDER_GETICON))
- pwd->extraIcons[i].hIcon = (HICON)CallService(MS_GENDER_GETICON, (WPARAM)pwd->hContact, 0);
- else {
- int iGender = db_get_b(pwd->hContact, "UserInfo", "Gender", 0);
- if (iGender == 0)
- iGender = db_get_b(pwd->hContact, szProto, "Gender", 0);
-
- if (iGender == GEN_FEMALE)
- pwd->extraIcons[i].hIcon = Skin_GetIcon("UserInfoEx_common_female");
- else if (iGender == GEN_MALE)
- pwd->extraIcons[i].hIcon = Skin_GetIcon("UserInfoEx_common_male");
- }
+ int iGender = db_get_b(pwd->hContact, "UserInfo", "Gender", 0);
+ if (iGender == 0)
+ iGender = db_get_b(pwd->hContact, szProto, "Gender", 0);
+
+ if (iGender == GEN_FEMALE)
+ pwd->extraIcons[i].hIcon = Skin_GetIcon("gender_female");
+ else if (iGender == GEN_MALE)
+ pwd->extraIcons[i].hIcon = Skin_GetIcon("gender_male");
pwd->extraIcons[i].bDestroy = false;
}
@@ -385,13 +381,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (pwd->bIsIconVisible[4]) {
for (i = 0; opt.exIconsOrder[i] != 4; i++);
- int iCountry = 0;
- if (ServiceExists(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY))
- iCountry = CallService(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY, (WPARAM)pwd->hContact, 0);
- else if (ServiceExists(MS_FLAGS_GETCONTACTORIGINCOUNTRY))
+ INT_PTR iCountry = CallService(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY, (WPARAM)pwd->hContact, 0);
+ if (iCountry == CALLSERVICE_NOTFOUND)
iCountry = CallService(MS_FLAGS_GETCONTACTORIGINCOUNTRY, (WPARAM)pwd->hContact, 0);
- if (iCountry != 0 && iCountry != CTRY_UNKNOWN && iCountry != CTRY_ERROR) {
+ if (iCountry != CALLSERVICE_NOTFOUND && iCountry != 0 && iCountry != CTRY_UNKNOWN && iCountry != CTRY_ERROR) {
pwd->extraIcons[i].hIcon = LoadFlagIcon(iCountry);
pwd->extraIcons[i].bDestroy = false;
}