Posted by hansbos on March 15, 2010 at 8:38am
2 followers
Jump to:
| Project: | Instant messenger |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | sound |
Issue Summary
On my site I use a base-directory in which drupal is installed.
For this case I noticed that the sound files couldn't be found because of a bug in im.module.
After changing the code as mentioned below, I was able to hear the notification sounds (to my regret only in FireFox, not in IE7).
Hans Bos
/* create the UI for IM console (display and command line)
*/
function im_make_block_console() {
global $base_path;
global $user;
$im_settings = array(
'refresh_rate' => variable_get('im_refresh_rate', 2000),
'im_refresh_rate_inactive_threshold' => variable_get('im_refresh_rate_inactive_threshold', 10000),
'im_refresh_rate_inactive' => variable_get('im_refresh_rate_inactive', 5000),
'drupal_root' => $_SERVER['DOCUMENT_ROOT'],
'anymsgs_url' => $anymsgs_url,
);
if (_has_audio()) {
$im_settings['has_audio'] = '1';
$im_settings['msg_in_mp3'] = $base_path . drupal_get_path('module', 'im') . '/msg_in.mp3';
$events = im_events();
foreach ($events as $event) {
/* $im_settings[$event['name']] = '/' . $event['sound_file']; */
$im_settings[$event['name']] = $base_path . $event['sound_file']; /* corrected */
}
}
Comments
#1
Thanks @hansbos It's nice to get actual code fixes from the community ;-)
I've made the fix in rev 1.9.2.24 of im.module
Raj