One chat per node

zarin - January 10, 2008 - 19:38
Project:Chat Room
Version:5.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:zarin
Status:active
Description

It would be great if users can create only one chat per node.
That is, when creating new chat room a chat is created automaticaly and user cant create new chat in this chat room.

#1

leoklein - November 21, 2008 - 20:13

I second the recommendation.

One of the people using a site I put together asked why she couldn't create a chat session just like she created any other node. This is a completely non-technical person. I personally was amazed that she understood the system well enough to expect such consistency.

#2

mbx - December 10, 2008 - 00:41

I am also very keen to see this feature added.

I'm not a developer but can help with logic, design and testing.

Initially I think a 'Create first chat automatically' checkbox could be added to the main chatroom form which could simply use the title as the name of the chat. This would obviously require additional validation eg. chat name uniqueness and permissions (create chatroom and create chats are separate permissions - the user will need both for this checkbox). I'm not sure about the implications of this approach but it seems to be the simplest way forward.

The second part of this is whether there should be a restriction on the number of chats that can be created in a chatroom. Just thinking out loud, but I'm not sure whether having this as a 'one chat per chatroom' or 'maximum number of chats per chatroom' would be desirable? My feel is max. number will suit more people and be more flexible without much additional effort. This should proabably be an independent setting to the automatic chat creation above.

These changes would need to be reflected in the chatroom node type defaults and chatroom edits/updates code would need to be thought through too.

Thoughts/comments?

Matt

#3

janusman - January 9, 2009 - 22:40

subscribing

#4

kansaj - March 17, 2009 - 09:43

I'm posting working prtotype of the of node per chat, which has some huge need for optimization. There some improvments made and it works through the activation as a block. with the following code:

<?php
if (arg(0) == 'node') {
$node = node_load(arg(1));
 
$chatnode=$node->nid;
$chatid = chatroom_chat_get_from_id_n("$chatnode");
$chatccid=$chatid->ccid;
if (
chatccid) {
  print
chatroom_chat_n($chatnode); }
}
?>

The posting is only for experimental needs because in many ways violates drupal principles.
The basic idea is that new local tasks chatroom is included; when pressed a new chat is established, which appear in the block.
The logic is that every node is per se chatroom. Still I cannot resolve the porblem with creation of blocck, which coudl show the user online per the exisiting node. The apporach till now has some analytical problems, especially between the idea if the chatroom as separated node, which I think could be futher adresed as an opiton.

AttachmentSize
chatroom.module.zip 14.12 KB

#5

kansaj - March 19, 2009 - 16:57

after some more testing better result with much improved logic:

<?php
if (arg(0) == 'node' && !(arg(1) == 'add') && !(arg(1) == 'ognodeadd')){
$node = node_load(arg(1));
 
$chatnode=$node->nid;
$chatnodesql= chatroom_chat_get_from_id_n("$chatnode");
$nodeccid=$chatnodesql ->ccid;
if (
$nodeccid) {
  print
chatroom_chat_n($chatnode); }
}
?>

I repeat, it is only for test use and needs huge optimization, but now it's working !

AttachmentSize
chatroom.zip 14.12 KB

#6

cedarm - April 3, 2009 - 18:49

Before I was part of the project, we forked chatroom in order to add some features to it, and have maintained it internally (called auditorium). Later I added the chat as node feature to this fork in order to use the schedule module to schedule publishing of a chat. Just to give an idea of how extensive the modification is, here's the diffstat:

auditorium.install |   32 +++
auditorium.module  |  494 +++++++++++++++++++++++++----------------------------
updates.inc        |    6
3 files changed, 269 insertions(+), 263 deletions(-)

I could post my patch, but it would probably be of limited use. Let me know if there's any interest.

 
 

Drupal is a registered trademark of Dries Buytaert.