Hi,

I'm searching for the best solution to provide 1-to-1 instant messaging functionality to logged-in users. My wishlist:
- a block with logged-in users (that's the easy part)
- when you click on a user, a chat window opens (no additional actions like login, create nickname, create chatroom etc.)
- when you send a message, it shows up on the screen of the other user
- not dependant on other accounts like msn, icq
- chats are 1-to-1; closed and invisible for others
- if possible, I would like not to be dependant of externally hosted 3rd party services
- Drupal 5

I've been looking at a number of modules, such as:
http://drupal.org/project/phpfreechat
http://drupal.org/project/messaging
http://drupal.org/project/ajaxim
http://drupal.org/project/xmpp
http://drupal.org/project/chatroom
Unfortunately they all seem to have their shortcomings. What would be the best solution? If there is not an out-of-the-box solution, should I take one of the modules and adapt it?

Thanks.

Comments

yanivya’s picture

Hi,
I'm a bit new to Drupal and I need that kind of an instant message 2.
I see that is has been a while since your last post.
Do U have a solution?

marcvangend’s picture

No sorry. We ended up creating a custom module, but that wasn't perfect either.

yanivya’s picture

Thanks for your quick reply.
As for the moment I am working with the "chat room". Do U know how can I put this chat room in a block?
As for the moment it is displayed on the front page of my site.

marcvangend’s picture

No, sorry, I can't help you with that.

rallyant’s picture

Did you work it out?
Id love to put a chat room in a block too!

caspercash’s picture

you might want to use this piece of code on your block.. just select 'php code' as your input format.. the value for the $chat_id will be the nodeID of the chatroom that you created from node/add/chatroom.


  if ($chat = chatroom_chat_get_from_id($chat_id)) {
    $content = '';
    if (chatroom_is_banned_user($chat->crid)) {
      $content .= theme('chatroom_chat_banned_user', $chat);
    }
    else {
      chatroom_chat_register_user($chat->ccid);
      chatroom_chat_set_cache($chat->ccid);
      drupal_add_css(drupal_get_path('module', 'chatroom') .'/chatroom.css');
      chatroom_chat_settings($chat);
      //$content .= theme('chatroom_chat', $chat);
      $content .= '<h2 style="text-align:center;">Chatroom</h2>';
      $content .= '<div id="chatroom-container">';
      $content .= theme('chatroom_chat_board');
      $content .= chatroom_smileys_get_textentry();
      if($user->uid > 0){
        //$content .= theme('chatroom_chat_textentry');
        $content .= '<div class="clear-both"></div>'."\n";
        $content .= '<div id="chatroom-textentry">'."\n";
        $content .= '<input type="text" id="chatroom-msg-input" size="50" maxlength="160" />'."\n";
        $content .= '<input type="submit" id="chatroom-msg-submit" value="'. t('Send') .'" />'."\n";
        
        $content .= '<div class="chatroom-textentry-options">';
        if (variable_get('chatroom_alerts', FALSE)) {
          $checked = variable_get('chatroom_alerts_default', FALSE) ? ' checked' : '';
          $content .= '<label><input type="checkbox"'. $checked .' id="chatroom-msg-alert" /> '. t('Alert me if new messages are received.') .'</label>';
        }
        $content .= '<div>'. l(t('View old messages'), "chatrooms/archives/{$chat->ccid}") .'</div>';
        $content .= "</div>\n";
        $content .= "</div>\n";
      }
      else{
        $content .= '<div style="clear:both"></div>';
        $content .= '<div class="chat-links">' . t('Click !here to login and chat!',array('!here' => l('here','user',array()))) . '</div>';
      }
      $content .= '</div>';
    }
    print $content;
  }