diff options
Diffstat (limited to 'plugins/TipperYM/src')
| -rw-r--r-- | plugins/TipperYM/src/common.h | 1 | ||||
| -rw-r--r-- | plugins/TipperYM/src/options.cpp | 41 | ||||
| -rw-r--r-- | plugins/TipperYM/src/popwin.cpp | 28 | ||||
| -rw-r--r-- | plugins/TipperYM/src/subst.cpp | 8 | ||||
| -rw-r--r-- | plugins/TipperYM/src/tipper.cpp | 4 | 
5 files changed, 36 insertions, 46 deletions
diff --git a/plugins/TipperYM/src/common.h b/plugins/TipperYM/src/common.h index b5d1043104..4e263bc11b 100644 --- a/plugins/TipperYM/src/common.h +++ b/plugins/TipperYM/src/common.h @@ -72,7 +72,6 @@ Boston, MA 02111-1307, USA.  #include <m_metacontacts.h>
  #include <m_variables.h>
  #include <m_smileyadd.h>
 -#include <m_gender.h>
  #include "resource.h"
  #include "version.h"
 diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 7cb70a98ba..25ea363932 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -584,8 +584,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP  			CheckDlgButton(hwndDlg, IDC_CHK_VALNEWLINE, di->bValueNewline ? TRUE : FALSE);
  			CheckDlgButton(hwndDlg, IDC_CHK_PARSETIPPERFIRST, di->bParseTipperVarsFirst ? TRUE : FALSE);
 -			int i;
 -			for (i = 0; presetItems[i].szID; i++)
 +			for (int i = 0; presetItems[i].szID; i++)
  				SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_ADDSTRING, 0, (LPARAM)TranslateTS(presetItems[i].swzName));
  			variables_skin_helpbutton(hwndDlg, IDC_BTN_VARIABLE);
 @@ -601,7 +600,6 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP  				{
  					case IDOK:
  					{
 -						int sel;
  						GetDlgItemText(hwndDlg, IDC_ED_LABEL, di->swzLabel, LABEL_LEN);
  						GetDlgItemText(hwndDlg, IDC_ED_VALUE, di->swzValue, VALUE_LEN);
 @@ -609,21 +607,22 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP  						di->bValueNewline = (IsDlgButtonChecked(hwndDlg, IDC_CHK_VALNEWLINE) ? true : false);
  						di->bParseTipperVarsFirst = (IsDlgButtonChecked(hwndDlg, IDC_CHK_PARSETIPPERFIRST) ? true : false);
 -						sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
 +						int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
  						if (sel != CB_ERR)
  						{
 -							TCHAR buff[256]; int i;
 +							TCHAR buff[256];
  							SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
 -							for (i = 0; presetItems[i].szID; i++)
 +							for (int i = 0; presetItems[i].szID; i++)
  							{
  								if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
 +								{
 +									if (presetItems[i].szNeededSubst[0])
 +										EndDialog(hwndDlg, IDPRESETITEM + i);
 +									else
 +										EndDialog(hwndDlg, IDOK);
  									break;
 +								}
  							}
 -
 -							if (presetItems[i].szNeededSubst[0])
 -								EndDialog(hwndDlg, IDPRESETITEM + i);
 -							else
 -								EndDialog(hwndDlg, IDOK);
  						}
  						else
  						{
 @@ -654,16 +653,17 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP  					int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
  					if (sel != CB_ERR)
  					{
 -						TCHAR buff[256]; int i;
 +						TCHAR buff[256];
  						SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
 -						for (i = 0; presetItems[i].szID; i++)
 +						for (int i = 0; presetItems[i].szID; i++)
  						{
  							if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
 +							{
 +								SetDlgItemText(hwndDlg, IDC_ED_LABEL, TranslateTS(presetItems[i].swzLabel));
 +								SetDlgItemText(hwndDlg, IDC_ED_VALUE, presetItems[i].swzValue);
  								break;
 +							}
  						}
 -
 -						SetDlgItemText(hwndDlg, IDC_ED_LABEL, TranslateTS(presetItems[i].swzLabel));
 -						SetDlgItemText(hwndDlg, IDC_ED_VALUE, presetItems[i].swzValue);
  					}
  				}
  			}
 @@ -700,16 +700,15 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l  					break;
  			}
 -			int index, id, i;
 -			for (i = 0; i < iTransFuncsCount; i++)
 +			for (int i = 0; i < iTransFuncsCount; i++)
  			{
 -				index = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateTS(translations[i].swzName));
 +				int index = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateTS(translations[i].swzName));
  				SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETITEMDATA, index, (LPARAM)translations[i].id);
  			}
 -			for (i = 0; i < iTransFuncsCount; i++)
 +			for (int i = 0; i < iTransFuncsCount; i++)
  			{
 -				id = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_GETITEMDATA, i, 0);
 +				int id = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_GETITEMDATA, i, 0);
  				if (id == ds->iTranslateFuncId)
  					SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETCURSEL, i, 0);
  			}
 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;
  						}
 diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index e4bcb782cd..36dadd8b6d 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -539,10 +539,10 @@ bool ApplySubst(HANDLE hContact, const TCHAR *swzSource, bool parseTipperVarsFir  	// pass to variables plugin if available
  	TCHAR *swzVarSrc;
 -	if (parseTipperVarsFirst == false)
 -		swzVarSrc = variables_parsedup((TCHAR *)swzSource, 0, hContact);
 -	else
 +	if (parseTipperVarsFirst)
  		swzVarSrc = mir_tstrdup(swzSource);
 +	else
 +		swzVarSrc = variables_parsedup((TCHAR *)swzSource, 0, hContact);
  	size_t iSourceLen = _tcslen(swzVarSrc);
  	size_t si = 0, di = 0, v = 0;
 @@ -894,7 +894,7 @@ TCHAR *GetProtoExtraStatusMessage(char *szProto)  				}
  			}
 -			TCHAR *tszParsed = (TCHAR *)variables_parse(swzText, NULL, hContact);
 +			TCHAR *tszParsed = variables_parse(swzText, NULL, hContact);
  			if (tszParsed)
  				replaceStrT(swzText, tszParsed);
  		}
 diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 4129c9a58a..76a50680b1 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -243,7 +243,7 @@ void InitFonts()  	hReloadFonts = HookEvent(ME_FONT_RELOAD, ReloadFont);
  }
 -int ModulesLoaded(WPARAM wParam, LPARAM lParam)
 +int ModulesLoaded(WPARAM, LPARAM)
  {
  	InitFonts();
 @@ -303,8 +303,6 @@ HANDLE hEventPreShutdown, hEventModulesLoaded;  extern "C" int __declspec(dllexport) Load(void)
  {
 -
 -
  	CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii);
  	mir_getTMI(&tmi);
  	mir_getLP(&pluginInfoEx);
  | 
