Instant messenger

Categories

Component ID

14553

Component name

Instant messenger

Component type

module

Component security advisory coverage

not-covered

Downloads

9105

Component created

Component changed

Component body

This module allows registered, active users on any Drupal site to communicate via instant messaging in real-time. Using jQuery and Ajax, the IM module is small, simple, and stands alone, not requiring any external instant messaging protocols and/or servers. This means that setup is a snap, and since this feature is a "nice-to-have," and uncoupled from any content and other functionality of your site, we encourage you to give it a spin.

Improvements and New Features

A couple of the enhancements made in rev 1.9.2.21 of im.module BREAK YOUR CURRENT CHATROOM SETTINGS !! .. but they are easy to fix. Please visit the chatroom settings admin/settings/im for full-on detailed and exampled help on how to convert your chatrooms and also make use of the cool new stuff.

  • Dec 1, 2009 Set up a default Chatroom that users automatically connect to after logging in
  • Dec 1, 2009 Any Chatroom can now have a moderator who is allowed to delete individual messages. Note ... there is a new permission "Moderate a Chatroom" that needs to be set for a user who you want to make a moderator on a chatroom
  • Dec 1, 2009 Make the "command line" into a sizable textarea, if that's what you want.
  • Dec 1, 2009 Various little changes to make the speaker icon and sound alert settings forms display for the appropriate users within specific circumstances
  • July 13, 2009 Audio Alerts -Admin must download (2k) file player_mp3_js.swf There are 4 events to which a sound can be assigned. User can override admin's settings by going to My Account | Edit. Admin can add more sounds by putting mp3 files in the modules "sounds" directory. User can turn sound on or off by clicking an icon in the Console.
  • July 4, 2009 - Chat Rooms have arrived in IM . Instructions on how to set up chat rooms can be found on the IM configuration settings page.
  • June 3, 2009 Support for languages requiring diacritics, such as accent marks.
  • May 18, 2009 IM exposes a hook so you can define you own list of friends to show up in the Friend Picker.
  • May 16, 2009 Performance boost - well actually a resource reduction - has been achieved by throttling server polling according to how active the user is in the conversation.
  • April 10, 2009 Support for using a View to generate the list of friends that show up on the Friend Picker.

Installation & Setup

Prerequisite(s): Drupal 6.x

Download and enable this module, set IM permissions for Authenticated Users to allow "IM talk", and enable the IM Friend Picker and IM Console blocks

Although IM will work out of the box, there are a few things you might like to adjust at Administer | Site Configuration | IM Settings.

  • Who is in the Friend Picker. By default IM will show All Users who are on-line. But you may like to take advantage of the these other methods, which will show up in the select list on the IM Settings page. You can use a User Relationship Type established by the User Relationships Module or a user-based View created by the Views Module or you can even make you own customized list friends by implementing hook_im_friends in your own custom module.
  • There are also some performance related options that let you fine tune how often IM polls for new messages and refreshes the Friend Picker.
  • And for great fun, download the Dialectic Module and pick a Bot Friend to talk to when there's no one else to chat with or you just feel like talking to Elmer Fudd or the Swedish Chef or a Pirate and other various and sundry characters.

Using IM

  1. Look at the "Friend Picker" to see a list of your "IM Friends" who are online.
  2. Click their name, type your message in the "command line", and press enter. You will see your message in your console.
  3. Your friend will see "(1)" next to your name in their Friend Picker. This indicates 1 unread message from you.
  4. After they click on your name in their Friend Picker, they will see your message.
  5. From then on, any messages you type to each other will show in each other's console. (You don't have to click their name to see it.)
  6. You can talk to other friends by clicking on their name. The console will switch to that conversation. You can switch back and forth between conversations by clicking on the name of the person you want to talk to.

Exposed Hooks

Hook: hook_im_friends
Arguments: none
Return: An array of integers representing uid's from table users.

example: this example returns an ordered list of users that have the role "Site Moderator"

function yourmodule_im_friends () {
  $uids = array();
  $results = db_query("
    SELECT ur.uid FROM {users_roles} ur INNER JOIN {users} u ON u.uid = ur.uid 
    INNER JOIN {role} r ON r.rid = ur.rid WHERE r.name = 'Site Moderator' ORDER BY u.name");
  while ($result = db_fetch_array($results)) {
    $uids[] = $result['uid'];
  }
  return $uids;
}

Commercial services and support

I will happily provide fee-based special customizations and support. Most of the work to date on this module, and that in the foreseeable future, is a labor of love on my part...any small contribution is greatly appreciated! (Because BEER, unlike speech, isn't FREE.) Contact me!