New Chat Module?

Events happening in the community are now at Drupal community events on www.drupal.org.
thomas4019's picture

I am thinking of making a chat module that would not require any external server or service to function, similar to http://drupal.org/project/chatroom. I don't like chatroom's way of doing things so I want to develop a new module. My desired result would a be a user to user chat very similar to gmail and facebook. I am thinking of integrating in with AppBar to make development easier as per this discussion, http://drupal.org/node/609884. Any suggestions or comments? Does anyone have a decent user to user chat that runs well without requiring an external service?

Comments

Hello! My clients wanted an

Cousken's picture

Hello!

My clients wanted an identical function, and we went as far as hiring a developer to look at that for us. After a month they came back with the information that it's not really possible due to the load it puts on the server. I looked for something like that for a very long time, but every stable solution i found has some sort of server running... In the end, we decided to go with LivePerson. I can guarantee you that a module like this would be very popular, if it can compete with external server solutions.

Thanks for the information!

thomas4019's picture

I think I have some ideas about how to make it work without putting a huge load on the server. My main idea is if the PHP timeout is a long time, like 5 minutes, then the client could request the server and just wait for the next post, as opposed to pinging the server every second. I am not sure if this solution is perfect, but I am sure there must be a way to make a non-external solution.

Thomas Hansen
www.ThomasHansen.me

If you'd like, i can send you

Cousken's picture

If you'd like, i can send you the code our developer left us along with their comments which described why it didn't work. After trying to build on Chatroom they switched to jqchat (jquerry?). Unfortunately the code is not commented, i haven't taken a look at it myself to say anything more.

That would be awesome.

thomas4019's picture

Yeah if you could pass that code and comments on to me that would be great. It will be very helpful to hear the problems they had encountered before I even start so I can see if I can find a solution. Thanks for being so helpful and sharing.

Thomas Hansen
www.ThomasHansen.me

You may wish to research the

Garrett Albright's picture

You may wish to research the long polling or "Comet" concept.

Yeah, that was exactly the

thomas4019's picture

Yeah, that was exactly the idea I had in mind. I just didn't know any name to really describe it.

Thomas Hansen
www.ThomasHansen.me

Why recreate the wheel?

brandon.dixon's picture

Sever hardware is so cheap right now and XMPP servers are capable of scaling to hundreds of thousands of clients. Gmail and Facebook both use XMPP on their chat implementations. Facebook actually runs a modified version of ejabberd while Google has rolled an internal solution to solve the problem. Whatever the case you use, you will not be able to replicate the amount of time spent and lessons learned from a project that has been thriving for years.

You are also fully capable of putting an XMPP server (though not desirable) on to the same server as your Drupal solution. I would strongly consider looking at the solutions out there because there is a lot of talk about this already within Drupal. There seems to be a lag in development and only a few people contribute, but I currently have a site with a full federated, scalable and flexible chatting mechanism using XMPP. Users are able to log communicate via mobile phones, thin clients or fat clients installed on the desktop. If I were you I would take a look into the XMPP Framework module and talk to the developer about modifying his Javascript client.

See this thread for some more information on Drupal related chat:
http://drupal.org/node/329799

Can someone run XMPP on a

thomas4019's picture

Can someone run XMPP on a shared host? Or do you really need a VPS or Dedicated server for XMPP? I really am wanting to make the easiest chat solution. I want a module where you download, install, enable like any other module and you just get chatting.

If you look at the usage statistics, Chat room is being used by 1,576 people while XMPP Framework is only being used by 255 people. This makes me think there are a lot of people looking for an easy solution.

A chating system is really a rather simple idea so I don't think I would be reinventing the wheel by making one. I feel like code to wrap XMPP over HTML might be longer than just a really simple chat module.

Thomas Hansen
www.ThomasHansen.me

Do some quick XMPP reading

brandon.dixon's picture

You can run XMPP on a shared host, but it depends on how far you want to scale. If you are looking at a small user base then you should be fine, but you must keep in mind that you are creating a serious single point of failure within your site. Sometimes taking the easy way out on a project will cost you a lot more later, so just keep that in mind when doing this.

I personally don't like chat room because you get no added benefit from it. You force users to use your site as their chatting mechanism and on top of that the solution solves a niche problem. The XMPP framework is a means to facilitate XMPP communications through a site. It just so happens that the module ships with a client and a bunch of other things. My understanding of the project and from experience working with it is that it just enables your site to speak in XMPP. This gives you the opportunity to develop what you want without the need to worry about integrating the XMPP specification into your site.

I would also agree that you are right in that people want easy. Solutions like Google Talk and Facebook just look so simple don't they? The reality is that in most cases they are pretty simple, but they require you to do some research and things on your own. Don't confuse wanting easy with just being lazy because I am sure a lot of those users looking for the patch solution are just not willing to put in the time. Is that a bad thing? Of course not. Some people want an out of the box solution, but again, I urge you to put some thought into what it is you want your site to gain from this.

You are correct in that chatting is a simple idea, but the issues always arise when implementing that simple idea into your environment with your requirements. As for XMPP going over HTML, there is already a solution for that. There are a couple libraries out there to do it and do some reading into BOSH. The beauty of XMPP is the openness of the protocol and chatting in general. If properly done your site could allow users to log in with their Google account, Yahoo or any other chatting mechanism because XMPP supports federation. Users could have their presence integrated into Drupal and have the ability to transfer files, use private chatting and group rooms among many other things.

I understand not everyone is a developer and you may not be one yourself, but you can't be ignorant to solutions that are already out there. Though they may look simple, they take work and understanding to make them great. Instant gratification is fine and if you want that then go with a crap solution, but keep in mind your users will get used to whatever you put in place. Any change may disrupt or anger them even when it is for the better. So I guess what I am getting at is do it right the first time and think about what you want. Not trying to come off harsh, but hopefully that provides some more insight into your problem.

Thanks so much for all this

thomas4019's picture

Thanks so much for all this advice. Sadly, I've pretty much already got the code written. But you have made some great points as to why XMPP is the better way to go. I really like the scalability and adaptability of XMPP. However, this is my first module so I might just get it rolled out as is. I definitely will be looking into XMPP in the future.

Thomas Hansen
www.ThomasHansen.me

Have you uploaded a project

Cousken's picture

Have you uploaded a project to the site yet? If so, could you link to it, i'm very interested in having a look at it.

The code is not quite

thomas4019's picture

The code is not quite finished yet. I got a basic working proof of concept and uploaded it here, http://drupal.org/node/609884#comment-3079932. But I since have made many revisions to make it have better performance, and to make the code up to Drupal CVS standards. I will try and post the enhanced code tomorrow. I am glad to see some interest in this module.

Thomas Hansen
www.ThomasHansen.me

Social Networking Sites

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: