summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewXstatusNotify/src/indsnd.cpp26
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp12
-rw-r--r--plugins/NewXstatusNotify/src/utils.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/xstatus.cpp4
4 files changed, 20 insertions, 24 deletions
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp
index 1f81d2ec3a..89488d3843 100644
--- a/plugins/NewXstatusNotify/src/indsnd.cpp
+++ b/plugins/NewXstatusNotify/src/indsnd.cpp
@@ -199,20 +199,20 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
PreviewSound(hList);
break;
case IDC_CHANGE:
- {
- int iSel = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_INDSNDLIST), -1, LVNI_SELECTED);
- if (iSel != -1) {
- TCHAR stzFilePath[MAX_PATH];
- if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
- iSel = -1;
- while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
- ListView_SetItemText(hList, iSel, 1, stzFilePath);
-
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ {
+ int iSel = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_INDSNDLIST), -1, LVNI_SELECTED);
+ if (iSel != -1) {
+ TCHAR stzFilePath[MAX_PATH];
+ if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
+ iSel = -1;
+ while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
+ ListView_SetItemText(hList, iSel, 1, stzFilePath);
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
}
}
- }
- break;
+ break;
case IDC_DELETE:
if (ListView_GetSelectionMark(hList) != -1)
if (RemoveSoundFromList(GetDlgItem(hwndDlg, IDC_INDSNDLIST)))
@@ -230,7 +230,6 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
TCHAR buff[MAX_PATH];
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
@@ -265,7 +264,6 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
TCHAR stzFilePath[MAX_PATH];
if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
int iSel = -1;
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
ListView_SetItemText(hList, iSel, 1, stzFilePath);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index e04e6739e5..e4091cb972 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -423,13 +423,12 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
}
if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
- WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ WORD wStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
TCHAR str[MAX_SECONDLINE] = { 0 };
- if (opt.ShowStatus) {
+ if (opt.ShowStatus)
GetStatusText(hContact, newStatus, oldStatus, str);
- }
- if (opt.ReadAwayMsg && myStatus != ID_STATUS_INVISIBLE && StatusHasAwayMessage(szProto, newStatus))
+ if (opt.ReadAwayMsg && wStatus != ID_STATUS_INVISIBLE && StatusHasAwayMessage(szProto, newStatus))
db_set_ws(hContact, MODULE, "LastPopupText", str);
PLUGINDATA *pdp = (PLUGINDATA *)mir_calloc(sizeof(PLUGINDATA));
@@ -1036,12 +1035,11 @@ int ProtoAck(WPARAM, LPARAM lParam)
if (ack->type == ACKTYPE_STATUS) {
WORD newStatus = (WORD)ack->lParam;
- WORD oldStatus = (WORD)ack->hProcess;
- char *szProto = (char *)ack->szModule;
-
+ WORD oldStatus = (DWORD_PTR)ack->hProcess;
if (oldStatus == newStatus)
return 0;
+ char *szProto = (char *)ack->szModule;
if (newStatus == ID_STATUS_OFFLINE) {
//The protocol switched to offline. Disable the popups for this protocol
db_set_b(NULL, MODULE, szProto, 0);
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp
index 8e592a5121..d850fb8d08 100644
--- a/plugins/NewXstatusNotify/src/utils.cpp
+++ b/plugins/NewXstatusNotify/src/utils.cpp
@@ -56,7 +56,7 @@ int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSe
void ShowLog(TCHAR *file)
{
- int res = (int)ShellExecute(NULL, _T("open"), file, NULL, NULL, SW_SHOW);
+ INT_PTR res = (INT_PTR)ShellExecute(NULL, _T("open"), file, NULL, NULL, SW_SHOW);
if (res <= 32) // error
MessageBox(0, TranslateT("Can't open the log file!"), TranslateT("NewXstatusNotify"), MB_OK | MB_ICONERROR);
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp
index e910f3155a..644134d4da 100644
--- a/plugins/NewXstatusNotify/src/xstatus.cpp
+++ b/plugins/NewXstatusNotify/src/xstatus.cpp
@@ -472,7 +472,7 @@ void LogXstatusChange(MCONTACT hContact, char *szProto, int xstatusType, TCHAR *
void AddXStatusEventThread(void *arg)
{
- MCONTACT hContact = (MCONTACT)arg;
+ MCONTACT hContact = (MCONTACT)(DWORD_PTR)arg;
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -503,7 +503,7 @@ void AddXStatusEventThread(void *arg)
void AddSMsgEventThread(void *arg)
{
- MCONTACT hContact = (MCONTACT)arg;
+ MCONTACT hContact = (MCONTACT)(DWORD_PTR)arg;
STATUSMSGINFO smi;
smi.hContact = hContact;