Set a maximum frequency for playing sounds #355

Merged
ghost merged 3 commits from master into master 2013-08-01 16:48:56 +02:00
ghost commented 2013-07-31 23:29:15 +02:00 (Migrated from github.com)

This avoids a lot of repeated "you've got mail" if you have multiple messages arrive on startup.

This avoids a lot of repeated "you've got mail" if you have multiple messages arrive on startup.
nimdahk commented 2013-08-01 04:15:25 +02:00 (Migrated from github.com)

self.lastSoundTime = datetime.datetime.now() should be called when the sound is actually played, not when it might be played. Otherwise, a message every 30 seconds will keep sounds from ever being played, rather than the intended result of having a sound played at maximum every 60 seconds.

I think.

`self.lastSoundTime = datetime.datetime.now()` should be called when the sound is actually played, not when it _might_ be played. Otherwise, a message every 30 seconds will keep sounds from ever being played, rather than the intended result of having a sound played at maximum every 60 seconds. I think.
ghost commented 2013-08-01 10:48:32 +02:00 (Migrated from github.com)

I wrote it deliberately that way so that the time is reset whenever a message is received. That way if you have a lot of messages being received a sound will only be played if a new message comes in 60 seconds after the last message was received. I can alter that though and make the time shorter or longer.

I wrote it deliberately that way so that the time is reset whenever a message is received. That way if you have a lot of messages being received a sound will only be played if a new message comes in 60 seconds after the last message was received. I can alter that though and make the time shorter or longer.
This repo is archived. You cannot comment on pull requests.
No description provided.