Skip to content

Commit

Permalink
Merge branch 'MDL-61375_master' of git://github.com/markn86/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Feb 12, 2018
2 parents 755310c + fb77b89 commit 0abe3fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mod/chat/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ function chat_update_instance($chat) {

$event = new stdClass();

if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'chat', 'instance' => $chat->id))) {
if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'chat',
'instance' => $chat->id, 'eventtype' => CHAT_EVENT_TYPE_CHATTIME))) {

if ($chat->schedule > 0) {
$event->type = CALENDAR_EVENT_TYPE_ACTION;
Expand Down Expand Up @@ -494,7 +495,8 @@ function chat_prepare_update_events($chat, $cm = null) {
$event->description = format_module_intro('chat', $chat, $cm->id);
$event->timestart = $chat->chattime;
$event->timesort = $chat->chattime;
if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'chat', 'instance' => $chat->id))) {
if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'chat', 'instance' => $chat->id,
'eventtype' => CHAT_EVENT_TYPE_CHATTIME))) {
$calendarevent = calendar_event::load($event->id);
$calendarevent->update($event);
} else if ($chat->schedule > 0) {
Expand Down

0 comments on commit 0abe3fe

Please sign in to comment.