diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdautoaway/autoaway.cpp | 13 | ||||
-rw-r--r-- | src/core/stdaway/sendmsg.cpp | 3 | ||||
-rw-r--r-- | src/core/stdidle/idle.cpp | 6 |
3 files changed, 10 insertions, 12 deletions
diff --git a/src/core/stdautoaway/autoaway.cpp b/src/core/stdautoaway/autoaway.cpp index 4e5d9e7fd8..a96c788c48 100644 --- a/src/core/stdautoaway/autoaway.cpp +++ b/src/core/stdautoaway/autoaway.cpp @@ -66,9 +66,13 @@ static void Proto_SetStatus(const char* szProto, unsigned status) static int AutoAwayEvent(WPARAM, LPARAM lParam)
{
- MIRANDA_IDLE_INFO mii;
- mii.cbSize = sizeof(mii);
+ MIRANDA_IDLE_INFO mii = { sizeof(mii) };
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
+
+ if (mii.idlesoundsoff)
+ iBreakSounds = (lParam & IDF_ISIDLE) != 0;
+
+ // we don't need to switch the status
if (mii.aaStatus == 0)
return 0;
@@ -109,13 +113,10 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam) }
}
- if (mii.idlesoundsoff)
- iBreakSounds = (lParam & IDF_ISIDLE) != 0;
-
return 0;
}
-int LoadAutoAwayModule(void)
+int LoadAutoAwayModule()
{
HookEvent(ME_SKIN_PLAYINGSOUND, AutoAwaySound);
HookEvent(ME_IDLE_CHANGED, AutoAwayEvent);
diff --git a/src/core/stdaway/sendmsg.cpp b/src/core/stdaway/sendmsg.cpp index ac9c01d74d..c0742aeb9a 100644 --- a/src/core/stdaway/sendmsg.cpp +++ b/src/core/stdaway/sendmsg.cpp @@ -111,8 +111,7 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) TCHAR substituteStr[128];
if ( !_tcsnicmp(dbv.ptszVal + i, _T("%time%"), 6)) {
- MIRANDA_IDLE_INFO mii = {0};
- mii.cbSize = sizeof(mii);
+ MIRANDA_IDLE_INFO mii = { sizeof(mii) };
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
if (mii.idleType == 1) {
diff --git a/src/core/stdidle/idle.cpp b/src/core/stdidle/idle.cpp index fc547c8b92..3f73f6511f 100644 --- a/src/core/stdidle/idle.cpp +++ b/src/core/stdidle/idle.cpp @@ -460,7 +460,7 @@ static int IdleOptInit(WPARAM wParam, LPARAM) static INT_PTR IdleGetInfo(WPARAM, LPARAM lParam)
{
MIRANDA_IDLE_INFO *mii = (MIRANDA_IDLE_INFO*)lParam;
- if ( !mii || (mii->cbSize != sizeof(MIRANDA_IDLE_INFO) && mii->cbSize != MIRANDA_IDLE_INFO_SIZE_1))
+ if ( !mii || mii->cbSize != sizeof(MIRANDA_IDLE_INFO))
return 1;
mii->idleTime = gIdleObject.minutes;
@@ -468,9 +468,7 @@ static INT_PTR IdleGetInfo(WPARAM, LPARAM lParam) mii->aaStatus = gIdleObject.aastatus;
mii->aaLock = gIdleObject.state&0x20;
mii->idlesoundsoff = gIdleObject.aasoundsoff;
-
- if (mii->cbSize == sizeof(MIRANDA_IDLE_INFO))
- mii->idleType = gIdleObject.idleType;
+ mii->idleType = gIdleObject.idleType;
return 0;
}
|