Uppon entering a chat, all the old messages would be loaded and shown to the user. I like this feature. But it gets problematic when there are a LOT of messages in the chat(thousands), my CPU usage would peek up to 100%, and the browser would stall for a few seconds, whenever I enter the chat.

It would be nice if there is an option to specify the number of old messages to be shown.

Comments

Anonymous’s picture

Assigned: Unassigned »

yes, i think this is good suggestion.

i'll try to implement it today.

cheers
justin

Anonymous’s picture

Status: Active » Fixed

i've added support for this - please test.

luperry’s picture

Status: Fixed » Active

Thank you for the speedy fix. But I was getting this warning when I tried to edit the chatroom:

warning: Wrong parameter count for range() in /*/modules/chatroom/chatroom.module on line 122.

though I was able to get it working by changing it directly on the mysql database.

On the side note, I was having some issues with the "automaticaly archive when everyone leaves" feature as well, when I go to "chatrooms/archives/1" it always tells me "This chat contains no messages", even after everyone has left the chat, and I see no other way to archive the messages. So I'm not sure if I'm doing something wrong or if this hasn't been fully implemented yet.

Anonymous’s picture

warnings: did you update the database schema?

sorry i didn't mention it, but i added a column to the db to store the number of old messages to display. the change is reflected in the chatroom.install file.

until the module code stabilises, there might be a few more changes to the db schema.

let me know if you need some help manually updating the table.

automatic archives: yep, i just haven't implemented this yet.

cheers
justin

pacheco’s picture

got that error too...

line 122 states:

'#options' => drupal_map_assoc(range(1, 250, 10)),

range function's thirth param ("step") was introduced in php 5, so i've added a workaround to avoid it's use

please update from cvs

luperry’s picture

Justin,

yes, I did update the database. the problem persists.

luperry’s picture

pacheco,

I see. I'm using php4, I guess that was the problem.

luperry’s picture

Status: Active » Fixed

it works great now.

Anonymous’s picture

Status: Fixed » Closed (fixed)