Skip to content

Commit

Permalink
Merge branch 'MDL-50853-master' of git://github.com/jleyva/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Sep 8, 2015
2 parents 7e0488e + cdb5d40 commit e907839
Show file tree
Hide file tree
Showing 9 changed files with 846 additions and 22 deletions.
5 changes: 5 additions & 0 deletions lib/db/services.php
Expand Up @@ -1160,6 +1160,11 @@
'mod_page_view_page',
'mod_resource_view_resource',
'mod_folder_view_folder',
'mod_chat_login_user',
'mod_chat_get_chat_users',
'mod_chat_send_chat_message',
'mod_chat_get_chat_latest_messages',
'mod_chat_view_chat',
),
'enabled' => 0,
'restrictedusers' => 0,
Expand Down
8 changes: 1 addition & 7 deletions mod/chat/chat_ajax.php
Expand Up @@ -109,13 +109,7 @@
$chatlasttime = time() - $CFG->chat_old_ping;
}

$params = array('groupid' => $chatuser->groupid, 'chatid' => $chatuser->chatid, 'lasttime' => $chatlasttime);

$groupselect = $chatuser->groupid ? " AND (groupid=".$chatuser->groupid." OR groupid=0) " : "";

$messages = $DB->get_records_select('chat_messages_current',
'chatid = :chatid AND timestamp > :lasttime '.$groupselect, $params,
'timestamp ASC');
$messages = chat_get_latest_messages($chatuser, $chatlasttime);

if (!empty($messages)) {
$num = count($messages);
Expand Down

0 comments on commit e907839

Please sign in to comment.