kandanapp/kandan — pull request #385 by JangoSteve (2014-09-15 04:57:06+00:00)
Title: Added options to modifier callbacks, fixed music player playback on scroll

There was a bug in the music player, which would cause audio files to play when loading previous messages as the user scrolled up. Managed to trace this to the music player modifer, which gets called on activity rendering, both when the message is created, and when the message is loaded from previous activities.

I fixed this by passing the options from `Views.ChannelPane` through to the `Views.ShowActivity`, which in turn passes options to the `Modifiers.process()` function, which in turn passes the options to the modifier callbacks as a third argument.

Then the music player modifier checks for the new `silence_music` option, which is passed when called from the `loadMoreActivities()` function.

Also, the music player modifier previously checked for `if true and Kandan.Data.Channels.activeChannelId()?` before playing the audio file. After looking through the entire git blame history of that line, apparently the `if true` part has been there since a rewrite of the plugin a ways back. It doesn't look like it's ever been functional, so I'm guessing it was just left over from debugging and they forgot to remove it before committing, and just no one has ever removed it. I.e. it was never functional in any way, so I removed that now too.