Skip to content

Commit

Permalink
Merge branch 'wip-MDL-43643-m26' of git://github.com/marinaglancy/moo…
Browse files Browse the repository at this point in the history
…dle into MOODLE_26_STABLE
  • Loading branch information
Sam Hemelryk committed Jan 27, 2014
2 parents 408b3ee + 929b5b3 commit 83bfad4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mod/chat/lib.php
Expand Up @@ -301,7 +301,6 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
// ok, last post was not for my group - we have to query db to get last message from one of my groups
// only minor problem is that the order will not be correct
$mygroupids = implode(',', $mygroupids);
$cm->mygroupids = $mygroupids;

if (!$mcm = $DB->get_record_sql("SELECT cm.id, MAX(chm.timestamp) AS lasttime
FROM {course_modules} cm
Expand Down Expand Up @@ -354,8 +353,11 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {

foreach ($current as $cm) {
//count users first
if (isset($cm->mygroupids)) {
$groupselect = "AND (chu.groupid IN ({$cm->mygroupids}) OR chu.groupid = 0)";
$mygroupids = $modinfo->groups[$cm->groupingid];
if (!empty($mygroupids)) {
list($subquery, $subparams) = $DB->get_in_or_equal($mygroupids, SQL_PARAMS_NAMED, 'gid');
$params += $subparams;
$groupselect = "AND (chu.groupid $subquery OR chu.groupid = 0)";
} else {
$groupselect = "";
}
Expand Down

0 comments on commit 83bfad4

Please sign in to comment.