Instant Messaging in Elgg via Jabber

Shortinfo
Licence: GNU General Public License
Version: 0.1 Beta
Requires: PHP 5, ejabberd 2, MySQL, Elgg 1.2
Description: Integrates JWChat in an Elgg installation and provides Instant Messaging via Jabber.

JWChat in Elgg
JWChat in Elgg Zoom

» View Demo

General

Thats an interessting point for several elgg users I guess: Jabberintegration for Elgg! As frontend I used a bit modified version of the web based JWChat. The backend communicates with the jabber server at database level and cares about correct registrations and buddy lists.

Please Note

  • Its a beta version. However it would be nice if I get a lot of feedback (especially windows user / IE) so that it doesn't stay a beta for too long.
  • Currently there is only ejabberd 2 and MySQL support, but its scheduled to extend that.
  • The browsersupport of JWChat should be simmilar with the browsersupport of this plugin.
  • This plugin needs access to the database used by the jabberserver.
  • Actually multi user chats (muc) are possible. Therefor the admins have to be hardcorded in the config file of ejabberd.

Installation

  • Set up ejabberd with MySQL native driver, descriped here. Adjust the additional modules mod_last, mod_offline, mod_roster and mod_vcard as well (like he descripes at the end). Tipp: Here you can download debian packages for erlang mysql support.
  • Make sure that either HTTP-Polling or HTTP-Binding is activated in the ejabberd config. For help please consult Google or the ejabberd doc.
  • Configure your webserver. How to do that is descriped in the README of JWChat (quote):

    • Setup your web server so that it redirects some local address like http://jabber.example.com/http-poll/ to some service that either implements HTTP Polling or HTTP Binding.

      Here is an example that should work with a default ejabberd installation on the same host:


      <VirtualHost *>
      ServerName jabber.example.com
      # (...)
      AddDefaultCharset UTF-8
      RewriteEngine on
      RewriteRule http-poll/ http://127.0.0.1:5280/http-poll/ [P]
      </VirtualHost>

      (...)

      Note 1: You need to enable mod_rewrite and mod_proxy at your apache configuration. Apache2 users also need to enable the protocol specific proxy module mod_proxy_http.

      Note 2: With JabberHTTPBind you don't need to do this sort of address rewriting if you're serving JWChat's files from within your servlet container directly or you're using some technique like mod_jk to mount a remote servlet engine directory transparently into your apache's domain of served addresses.

    • Restart your web server.

    • Test if this redirect works. Following the example above point your browser to http://jabber.example.com/http-poll/. You should see the same response as if you you're pointing it to http://jabber.example.com:5280/http-poll/.

    However that didn't satisfied me. I found my happiness with following lines.


    <VirtualHost *>
    ProxyPass /http-bind/ http://127.0.0.1:5280/http-bind/
    ProxyPassReverse /http-bind/ http://127.0.0.1:5280/http-bind/
    # further more stuff..
    (...)
    </VirtualHost>

    Replace 127.0.0.1 with the server address of youre ejabberd.

  • Now the plugin comes into play. Download and extract it, copy the jabber folder into the mod folder of the elgg installation and activate the plugin in the admin interface of elgg.
  • Configure the plug in in the elgg admin interface. Look at the screenshot above to get my test configuration. Note: In most instances you cannot run the jabberserver as localhost, because your user won't be able to connect to it.
  • The connection data to the database used by the jabberserver are not configured by admin interface (because of security issues). Instead you have to edit the file mod/jabber/config.db.php.
  • If all seems fine you should remove the module mod_register from the ejabberd configuration file. After that only the plugin is able to change passwords or registrate users.
  • Thats it! Surely its a bit nasty to come to this point, but at the end all efforts pay off :) If you have issues don't hestitate to leave a comment and I will help you as good as it is possible for me.

Download

Comments

Tested in elgg 1.7 but not work

Hi I try in elgg 1.7 I install all Mysql databases .... all is working in ejabberd but in elgg after I configure database and the host configuration I go to Tools Jabber But I not see nothing and I not see any apache error.
I try to change for few templates and the resort is the seam.
I see in the footer javascript:jabber_init()
Any idea how solve the problem?

Thanks in advance

Elgg 1.7.1

Hi,

I only tested it with elgg 1.2, but I'm going to make the plugin work with newer versions when I have time for that.

Regards,
Felix

elgg 1.5 and browser support

Hello, I've installed your plugin and it works with elgg 1.5.
However there seems to be a problem with safari and konqueror.
The popup shows up, the user is registered in ejabberd, but it doesn't seems to make
the connection.

Hello, nice to see there is such a plugin

I had a few problems with the plugin elggchat, so I installed jabberd2 on my server.
I was thinking I had to write a plugin for elgg, but it already exists.
I haven't tested it already, but I will give it a try within days.
I'll give some news about the testing.

when I click on the Jabber link on my Elgg page, No Popup

When I click on the link of the Elgg page, I get no popup....
what might be the case??

Re: when I click on the Jabber link on my Elgg page, No Popup

Well, try to be more detailed. Did you set the jabber server properly? Did you try the sanity checks descriped in the installation guide above? Can you connect to the jabber server with a common client?

Greetings

Works with Elgg 1.5?

Works with Elgg 1.5?

Elgg 1.5

Not tested yet