Chat now logs "talk" events ... which also updates last access in the course

so chatters appear in the online users block so Tom is happy.  :-)

Seriously though, it's good to have talking events in the log.
This commit is contained in:
moodler 2004-04-30 12:40:42 +00:00
parent db7da819d5
commit 2c0d657437
6 changed files with 16 additions and 2 deletions

View file

@ -33,6 +33,10 @@ function chat_upgrade($oldversion) {
chat_refresh_events(); chat_refresh_events();
} }
if ($oldversion < 2004043000) {
modify_database("", "INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');");
}
return true; return true;
} }

View file

@ -58,4 +58,5 @@ INSERT INTO prefix_log_display VALUES ('chat', 'view', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'add', 'chat', 'name'); INSERT INTO prefix_log_display VALUES ('chat', 'add', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'update', 'chat', 'name'); INSERT INTO prefix_log_display VALUES ('chat', 'update', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'report', 'chat', 'name'); INSERT INTO prefix_log_display VALUES ('chat', 'report', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');

View file

@ -16,6 +16,10 @@ function chat_upgrade($oldversion) {
chat_refresh_events(); chat_refresh_events();
} }
if ($oldversion < 2004043000) {
modify_database("", "INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');");
}
return true; return true;
} }

View file

@ -55,3 +55,4 @@ INSERT INTO prefix_log_display VALUES ('chat', 'view', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'add', 'chat', 'name'); INSERT INTO prefix_log_display VALUES ('chat', 'add', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'update', 'chat', 'name'); INSERT INTO prefix_log_display VALUES ('chat', 'update', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'report', 'chat', 'name'); INSERT INTO prefix_log_display VALUES ('chat', 'report', 'chat', 'name');
INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');

View file

@ -20,7 +20,7 @@
require_login($chat->course); require_login($chat->course);
if ($groupid) { if ($groupid) {
if (!isteacheredit($course->id) and !ismember($groupid)) { if (!isteacheredit($chat->course) and !ismember($groupid)) {
error("You can't chat here!"); error("You can't chat here!");
} }
} }
@ -45,6 +45,10 @@
$chatuser->lastmessageping = time(); $chatuser->lastmessageping = time();
update_record("chat_users", $chatuser); update_record("chat_users", $chatuser);
if ($cm = get_coursemodule_from_instance("chat", $chat->id, $chat->course)) {
add_to_log($chat->course, "chat", "talk", "view.php?id=$cm->id", $chat->id, $cm->id);
}
} }
/// Go back to the other page /// Go back to the other page

View file

@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php /// This fragment is called by moodle_needs_upgrading() and /admin/index.php
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
$module->version = 2004042500; // The (date) version of this module $module->version = 2004043000; // The (date) version of this module
$module->requires = 2004013101; // Requires this Moodle version $module->requires = 2004013101; // Requires this Moodle version
$module->cron = 300; // How often should cron check this module (seconds)? $module->cron = 300; // How often should cron check this module (seconds)?