summaryrefslogtreecommitdiff
path: root/src/core/stdautoaway
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-21 20:43:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-21 20:43:46 +0000
commit6f2c99a32c9e539fc61edb6b836e8805b013a180 (patch)
treeb0108fbaf865ad5dc7522a55f8ca272bf0df7600 /src/core/stdautoaway
parent365b792d3509d4e94cdc31ee4384bf458f152e59 (diff)
- unused constant MIRANDA_IDLE_INFO_SIZE_1 removed;
- proper tracking of autoaway sound options; - code cleanup for MIRANDA_IDLE_INFO initialization; git-svn-id: http://svn.miranda-ng.org/main/trunk@4156 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdautoaway')
-rw-r--r--src/core/stdautoaway/autoaway.cpp13
1 files changed, 7 insertions, 6 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);