Hello,

I was looking through the module list, and was wondering if there are any plans to port Chatroom to 6.x?

Thanks for any information you can provide on this --

Cheers,

Bill

Comments

darren oh’s picture

I am tied up right now and haven't heard from any volunteers.

bonobo’s picture

Are you looking for co-maintainers on this, or for someone to sponsor you to write the patch, or for someone from the community to write the patch, or some combination of the above?

We're pretty full up at the moment, but might be able to put some time into porting this later in April/early May, if nothing happens sooner than that.

Would you be open to a patch? Are there any specific features you were thinking of adding in during the D6 port? I read over the roadmap on g.d.o, but the last edit to that was in December 2007, and the last code commit here was in early January, so in the interest of not reinventing the wheel I'd want to make sure we were on the same page before starting any coding.

Cheers,

Bill

darren oh’s picture

I'm open to all of the above. I haven't written any code since producing the road map. I have a full-time employer now, so even if someone chose to sponsor development, it would be some time before I could get to it unless someone else is interested in the job.

darren oh’s picture

Status: Active » Postponed
Pedro Lozano’s picture

Status: Postponed » Needs review
StatusFileSize
new14.37 KB

This is just a "just works" patch, without any inprovement, no schema api, etc..

The patch is derived from chatroom-5.x-1.9.tar.gz.

Pedro Lozano’s picture

StatusFileSize
new37.28 KB

This is a more elaborated patch, with schema api and more.

Tested patching cvs HEAD and chatroom-5.x-1.9.tar.gz

Still not working is mp3 upload for notifications. I don't exactly know how to get rid of those file_check_upload calls yet.

ultrasparq’s picture

Hello,

I'm new to drupal so I hope I dont annoy you by asking...how do I apply the patch?

thanks

Fayna’s picture

boriso’s picture

Hi !

Thanks a lot to pl2 for the drupal-6 patch.

So, with chatroom-6.x-HEAD.patch applied, it worked relatively fine for me, except that the usernames fail to show up when using Internet Explorer 7 (works fine with Firefox). Also, again with IE7, only "this" user shows up in the chatroom "who's online block". The other users are not listed.

Thanks again for the great work, looking forward for an official release of the chatroom module for D6 sometime !

Fayna’s picture

Patch worked fine for me. The only issue I had was with those file_check_upload errors.

Paul Natsuo Kishimoto’s picture

Assigned: Unassigned » Paul Natsuo Kishimoto

I need to set up a simple chat for a D6 website for my employer, so in a sense I'm being paid (although not explicitly) to do this. I was able to get 6.x branch of webserver_auth established with moshe weitzman's help in #206223: Update for 6.x, so I will also try to write a patch here suitable for setting up a 6.x branch, if that's OK.

Infanty’s picture

Thanks!!!

boriso’s picture

Yes ! That would be fantastic ! Go Paul Go !

root_of_roots’s picture

subscribing

Cheers!

Paul Natsuo Kishimoto’s picture

StatusFileSize
new105.16 KB

This is turning out to be a pretty substantial rewrite. I'm going to post a single big patch later in a separate issue with a long list of changes, but here's a preview. Some things like archiving, private messages and archiving/deletion still aren't working; there is also no upgrade path for several largish changes to the DB schema. The basic chat feature works, at least on my test setup.

Overall I'm pretty impressed by D6, the API documentation, Drupal's AHAH features and jQuery's flexibility, which are letting me discard large sections of code while keeping the functionality of the original.

Comments are welcome.

root_of_roots’s picture

subscribing to the conversation. Will be sure to test it and looking forward to fully working chatroom!

benhammond’s picture

Comments on chatroom-6.x-dev.tar_.gz.

Hi
I am trying to get the above dev release running and am trying to get a feel for what is broken because its just a dev release and what is broken because I don't know what I am doing.

I am running drupal-6.4 on apache 2.2.8, MySQL 5.0.51, PHP 5.2.4-2ubuntu5.3

I've had a few problems with the column chatroom_chat.nid not existing (think its been partially renamed chatroom_chat.ccid), and a few other assorted MySQL syntax problems, but those are all now fixed.

My current probelm is that the 'Submit' button is missing. It looks like this is by design, but simply pressing 'return' doesn't seem to send the new chat message to the server either.
My question (to Paul) is

How is this supposed to work? I'm assuming there should be some javascript that is looking out for \n's typed into the message field, and then posting the message to the server using chatroomread.php... but I haven't been able to find the javascript that does this?

Is it simply that it's not yet implemented? I'm quite keen to get this up and running, so if youtell me how its supposed to work I can look at doing it?

Or should the functionality already be in place, and I'm barking up the wrong tree?

Thanks alot

Ben.

root_of_roots’s picture

Hmmm...I get a lot of errors after trying to "Create" a chat room:

* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT bl.uid, u.name FROM chatroom_ban_list bl INNER JOIN users u ON u.uid = bl.uid WHERE bl.nid = 12 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 274.
* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT COUNT(nid) FROM chatroom_ban_list WHERE nid = 12 AND uid = 1 LIMIT 0, 1 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 1071.
* user warning: Unknown column 'cc.nid' in 'on clause' query: SELECT (SELECT COUNT(*) FROM chatroom_msg WHERE ccid = cc.ccid AND recipient = '') AS msg_count, MAX(cm.cmid) AS last_cmid, cc.ccid, cc.chatname, cc.when_archived FROM chatroom cr INNER JOIN chatroom_chat cc ON cc.nid = cr.nid LEFT JOIN chatroom_msg cm ON cm.ccid = cc.ccid AND cm.recipient = '' WHERE cr.nid = 12 GROUP BY cc.ccid, cc.chatname, cc.when_archived in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 231.
* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT COUNT(nid) FROM chatroom_ban_list WHERE nid = 12 AND uid = 1 LIMIT 0, 1 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 1071.
* user warning: Unknown column 'nid' in 'where clause' query: SELECT COUNT(ccid) FROM chatroom_chat WHERE nid = 12 AND chatname = 'cfbchat' AND when_archived IS NULL LIMIT 0, 1 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.forms.inc on line 403.
* user warning: Unknown column 'nid' in 'field list' query: INSERT INTO chatroom_chat (nid, uid, chatname, modified) VALUES (12, 1, 'cfbchat', 1222010328) in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.forms.inc on line 416.
* There was an error creating your chat
* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT bl.uid, u.name FROM chatroom_ban_list bl INNER JOIN users u ON u.uid = bl.uid WHERE bl.nid = 12 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 274.
* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT COUNT(nid) FROM chatroom_ban_list WHERE nid = 12 AND uid = 1 LIMIT 0, 1 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 1071.
* user warning: Unknown column 'cc.nid' in 'on clause' query: SELECT (SELECT COUNT(*) FROM chatroom_msg WHERE ccid = cc.ccid AND recipient = '') AS msg_count, MAX(cm.cmid) AS last_cmid, cc.ccid, cc.chatname, cc.when_archived FROM chatroom cr INNER JOIN chatroom_chat cc ON cc.nid = cr.nid LEFT JOIN chatroom_msg cm ON cm.ccid = cc.ccid AND cm.recipient = '' WHERE cr.nid = 12 GROUP BY cc.ccid, cc.chatname, cc.when_archived in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 231.
* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT COUNT(nid) FROM chatroom_ban_list WHERE nid = 12 AND uid = 1 LIMIT 0, 1 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 1071.

and this is what I get after going to .../chatroom
No Chat Rooms Defined:

user warning: Unknown column 'cc.nid' in 'on clause' query: SELECT cr.nid, n.title, COUNT(cc.ccid) AS chat_count FROM chatroom cr INNER JOIN node n ON n.nid = cr.nid INNER JOIN node_revisions nr ON nr.nid = n.nid LEFT JOIN chatroom_chat cc ON cc.nid = cr.nid GROUP BY cr.nid, n.title, n.sticky, nr.timestamp ORDER BY n.sticky DESC, nr.timestamp DESC in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 1096.

So I could not get it to work.

Thanks for the port.
Best Regards,
-ROR

Paul Natsuo Kishimoto’s picture

Hi guys—thanks for the comments. I am still working on this! If the maintainer is paying attention, I wonder if it would be worth starting a 6.x branch in CVS for these assorted comments to go against. I will try and post a better version in the next week to be the basis for a branch...

@benhammond: yes, this is supposed to be the functionality. In chatroom.js, notice:

Drupal.behaviors.chatroom = function(context) {
  $('#chatroom-chat-form:not(.chatroom-processed)', context).addClass(
    'chatroom-processed').each(function() {
    ...
    // Actions that send a message.
    $('#edit-message', context).keypress(function(event) {
      if (event.keyCode == 13) {
        sendMessage();
      }
    });
    ...
  });
};

Roughly parsing this: process the chatroom-chat-form, and add a behaviour to the HTML element with ID 'edit-message' (this is the text input for chat messages). Whenever a key is pressed, if the key code is 13 (Enter), trigger the sending of a message.

Since this is Javascript, it's executed on the client side, so the server specs probably don't matter so much. What platform/browser are you accessing with? Maybe the code should using another means of checking for an Enter/Return keypress. Also, if you have Firefox or something else with a "Javascript Console", please post any error messages that pop up during this process.

@ror: I will have to look into the code and see what is causing this.

For both of you, did you try upgrading from a previous version (note from #15 there is no upgrade path yet), or were these clean installs? That would be helpful in debugging.

root_of_roots’s picture

Hello Paul.

It was a fresh install.

I think I should point this out. My failed attempt at creating a chatroom was promoted to front page.

My front page displays this error now:

* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT bl.uid, u.name FROM chatroom_ban_list bl INNER JOIN users u ON u.uid = bl.uid WHERE bl.nid = 12 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 274.
* user warning: Table 'xdrupal.chatroom_ban_list' doesn't exist query: SELECT COUNT(nid) FROM chatroom_ban_list WHERE nid = 12 AND uid = 1 LIMIT 0, 1 in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 1071.
* user warning: Unknown column 'cc.nid' in 'on clause' query: SELECT (SELECT COUNT(*) FROM chatroom_msg WHERE ccid = cc.ccid AND recipient = '') AS msg_count, MAX(cm.cmid) AS last_cmid, cc.ccid, cc.chatname, cc.when_archived FROM chatroom cr INNER JOIN chatroom_chat cc ON cc.nid = cr.nid LEFT JOIN chatroom_msg cm ON cm.ccid = cc.ccid AND cm.recipient = '' WHERE cr.nid = 12 GROUP BY cc.ccid, cc.chatname, cc.when_archived in /var/www/xdrupal/sites/all/modules/chatroom/chatroom.module on line 231.

Hope this helps,
Cheers,
-ROR

benhammond’s picture

That problem with chatroom_ban_list is because chatroom install contains a non-existent column in its primary key definition.

I changed line 85 to read
'primary key' => array('admin_uid', 'uid'),

benhammond’s picture

Hi Paul

thanks for the pointers, very helpful.

I can see that
function sendMessage() is correctly being called and is in turn calling
$('#edit-submit').triggerHandler('mousedown');
but nothing then happens; the new message is never sent to the server.

I cannot find where any js function is attached to the mousedown event().
I cannot see where #edit-submit is defined. (chatroom.forms.inc defines $form['control']['submit']
which looks like it should be the right thing, but I can't see how it would
be mapped to #edit-submit).

Perhaps that is the problem.
I'll continue to play around with it.

Cheers
Ben.

benhammond’s picture

Hi there

I've got to the point where I can see chat dynamically updating on the screen.
However, since the #edit-last-cmid field is NOT updated by the AHAH reponse,
every poll will re-request all the chat data from the same last-cmid.

So I see a screen that quickly fills up with garbage.
Hmmm, I suppose we could move the #edit-last-cmid field to be inside the
#chatroom-board so that AHAH has a chance to update it

or maybe we could include some javascript in the AHAH response that would
force an update to the contents of #edit-last-cmid. (Ugh)

or is there some blindingly obvious solution that I can't see?

any ideas

thanks
Ben.

Paul Natsuo Kishimoto’s picture

Ben, the following function is supposed to do what you describe:

/**
 * Latest message ID.
 *
 * Updates <input type="hidden" id="edit-last-cmid" value="..."/> from
 * <div id="response-last-cmid">...</a>. This is sent with each AHAH request so
 * messages are not fetched more than once.
 */
Drupal.behaviors.chatroomLastCmid = function(context) {
  $('#response-last-cmid', context).each(function() {
    $('#edit-last-cmid').val($(this).html());
  }).remove();
};

...as far as my understanding goes, the standard Drupal jQuery/AHAH functionality calls every function attribute of Drupal.behaviors whenever the page loads, or whenever a portion of the page is replaced by an AHAH response. In the latter case, "context" contains a jQuery reference to the contents of the AHAH update. For chatroom, any AHAH response should include something like <div id="response-last-cmid">12345</div> which triggers the above code. Any chance you could profile where this process derails on your end?

benhammond’s picture

got it working

my problem was that Drupal.behaviours.chatroomMessages was bombing out when it came to the
soundManager.play('message')

since soundManager is not loaded. This then prevented any of the subsequent behaviours (of which chatroomLastCmdId was one) from running.

I've commented out the call to soundManager and it's now working.

I've not been keeping close track of the changes I've made. Shall I post the hacked-up version of Paul's code that I've been working on, and we'll figure out what the diffs are from there?

cheers
Ben.

defconpuck’s picture

Hey,

I've also started hacking on this new potential branch. I'm planning on working on this pretty furiously over the next few weeks, because we (my team) need a functioning chat room for the site we are building.

Just for reference, the site is part of an InterProfessional Project (IPRO) at the Illinois Institute of Technology.

-Ian

benhammond’s picture

StatusFileSize
new106.45 KB

Hi there

this is what I did to Paul's code in order to get it working on my machine; mostly just fixing up some of the column IDs that hadn't been consistently changed and commenting out the trouble some call to soundManager.

I also hard-coded the DEBUG flag to true; I've got a suspicion that there is some necessary code that is sitting inside a DEBUG block, but I haven't had time to fully investigate.

mm167’s picture

how about a audio/video feature in 6.x version?

mitchell’s picture

#27 is AWESOME. Thanks for the great module and the subsequent work!

I created a chat as admin, gave authenticated users permissions to chat, and masqueraded back and forth between admin and test user on the chat page.

Worked Great For Me!

Until there's a 6.x branch opened, I'll post the bugs here:
There was an error when I turned on archiving, but when I turned it back off, it was fine. It was on line 636.

There's a sweet +/- button on the bottom right with the error message underneath, this is what it had:

soundManager.initComplete(): calling soundManager.onerror()
-- SoundManager 2 failed to load (security/load error) --
soundManager.disable(): Disabling all functions - future calls will return false.
soundManager: Failed to initialise.
soundManager: No Flash response within reasonable time after document load.
Possible causes: Flash version under 8, no support, or Flash security denying JS-Flash communication.
soundManager: Getting impatient, still waiting for Flash.. ;)
soundManager.beginDelayedInit(): Document loaded
soundManager._initMovie(): Waiting for ExternalInterface call from Flash..
soundManager._initMovie(): Got EMBED element (created via JS)
soundManager._createMovie(): Trying to load ./soundmanager2.swf
-- SoundManager 2 V2.76a.20080808 (AS2/Flash 8) --

mitchell’s picture

Title: Any plans/timeline for 6.x port of chatroom? » Official 6.x-dev release of Chat Room
Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

Updating status and title.

Anonymous’s picture

subscribing.

darren oh’s picture

Which file contains the reviewed and tested patch?

Paul Natsuo Kishimoto’s picture

Status: Reviewed & tested by the community » Active

@mitchell: did you test an upgrade, or only a fresh install?

@Darren: There is none. I think mitchell was being a bit overzealous; this is only debatably important, nor is there a patch, and "official 6.x-dev release" is a misnomer. Unless benhammond has done a lot more work in #27, it is still only suitable for fresh installs because there is no update path as I noted in #15. The schema changes are significant and users would lose data if they tried to upgrade.

I would be more cautious and say we have enough working code for a "6.x-2.x-dev" branch of this module, provided you're willing to put a boldface notice on the module node at http://drupal.org/project/chatroom cautioning users not to attempt to upgrade using 6.x-2.x-dev. I have seen this done with other modules (the names of which I can't remember at the moment...sorry!)—the official 6.x-2.0 release would only come once we have written and tested an upgrade path. This is up to the maintainer (you).

@benhammond: can you create a patch against HEAD using the contents of your latest tarball? I would do this myself, but I can't vouch for any changes you've made to my code from #15.

Also, my apologies to everyone for giving this less attention than I did during the summer; I am back in school and research/coursework is occupying most all of my waking hours.

Anonymous’s picture

yes, i'd love to see a 6.x dev branch. would make it much easier to hack on this.

mitchell’s picture

Assigned: Unassigned » Paul Natsuo Kishimoto
StatusFileSize
new264.67 KB

@Darren Oh: Here's a patch made from #27. The results of my review are in #29.

@Paul Kishimoto: Fresh install worked well; I haven't tried to upgrade using it, can you please test an upgrade with this patch?

Also, hook_update_N() is included in the patch, and the comments for the upgrade section seem to suggest it'll work, so I'm going to mark this rtbc.

mitchell’s picture

Assigned: Paul Natsuo Kishimoto » Unassigned
Status: Active » Needs review

Seems like Darren is the only maintainer. I'll send him a pm as well.

mitchell’s picture

Assigned: Paul Natsuo Kishimoto » Unassigned
Status: Needs review » Reviewed & tested by the community
mitchell’s picture

Status: Reviewed & tested by the community » Fixed

I committed #35, so there is now a 6.x branch and a BETA-1 release. I would like to end any discussions related to bugs, feature requests, or alternate patches for porting this module in this thread.

To all those who tested these patches or helped create them, please continue to support this module toward a 6.x-1.0 stable release. All of us who commented in this thread are looking forward to it.

Known issues moving forward (please file these issues separately):
@benhammond: debug output still shown
@mm167: audio/video support
@Paul Kishimoto: upgrade path still untested

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

himtuna’s picture

when I open the chatroom
I am getting this error

( testing environment: localhost (url localhost/groups/) (http://localhost/groups/chatroom/chat/1)

An error occurred.
/groups/chatroom/js
<br />
<b>Warning</b>: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of system_settings_form_submit(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in <b>C:\server\www\groups\sites\all\modules\chatroom\chatroom.forms.inc</b> on line <b>303</b><br />
{ "status": true, "data": "\x3cdiv class=\"ahah-response\" id=\"response-messages\"\x3e\x3c/div\x3e\x3cdiv class=\"ahah-response\" id=\"response-users\"\x3e\x3cdiv id=\"chatroom-user-list\" class=\"item-list\"\x3e\x3cul\x3e\x3cli class=\"first last\"\x3e\x3ca href=\"/groups/user/1\" title=\"View user profile.\"\x3eHimtuna\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\"ahah-response\" id=\"response-control\"\x3e\x3c/div\x3e" }