Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: deltatech on May 08, 2011, 03:05:47 PM

Title: Problem with Accounts Plugin when used with sound_notifier
Post by: deltatech on May 08, 2011, 03:05:47 PM
The accounts plugin is great, and so is the webmail notifier [edit: sound_notifier, see below], but when you use the two together, there is a big problem.

When you select an account other than the main account, the webmail notifier notifies you once per minute even if there are no new messages.  This does not stop until you select the main account.
Title: Problem with Accounts Plugin when used with sound_notifier
Post by: rosali on May 09, 2011, 02:06:03 AM
Could you please describe a little bit more exactly.

Settings of Webmail Notifier FF plugin etc.

I don't see the problem.
Title: Problem with Accounts Plugin when used with sound_notifier
Post by: deltatech on May 09, 2011, 02:10:17 AM
Quote from: rosali;34744Could you please describe a little bit more exactly.

Settings of Webmail Notifier FF plugin etc.

I don't see the problem.

Sorry, i don't know what i was thinking.. It isn't Webmail Notifier, it is Sound Notifier.

To duplicate the problem, all you have to do is assign a sound to notifiy when messages come in.   Then go select an account other than the primary account and wait.  Once per minute, an alert will go off until you switch back to the main account.
Title: Problem with Accounts Plugin when used with sound_notifier
Post by: rosali on May 09, 2011, 03:14:09 AM
sound_notifier.php

Replace method 'play_sound' by:


  function play_sound($args){
    $rcmail = rcmail::get_instance();
    if($rcmail->config->get('sound_notifier') && strtolower($_SESSION['username']) == strtolower($rcmail->user->data['username']))
      $rcmail->output->command("plugin.sound");
  }


Please post, if it behaves now as desired. Notice that it will not play sounds for remote accounts. This is not possible, because the plugin uses the 'new_messages' hook which checks only for new messages arriving in the default account.
Title: Problem with Accounts Plugin when used with sound_notifier
Post by: deltatech on May 09, 2011, 12:38:07 PM
Quote from: rosali;34747sound_notifier.php

Replace method 'play_sound' by:


  function play_sound($args){
    $rcmail = rcmail::get_instance();
    if($rcmail->config->get('sound_notifier') && strtolower($_SESSION['username']) == strtolower($rcmail->user->data['username']))
      $rcmail->output->command("plugin.sound");
  }


Please post, if it behaves now as desired. Notice that it will not play sounds for remote accounts. This is not possible, because the plugin uses the 'new_messages' hook which checks only for new messages arriving in the default account.

That fixed the problem.  Thanks.