Skip to content

Commit

Permalink
MDL-31941 chat: removed chat_get_participants, deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja committed May 11, 2012
1 parent e16e230 commit 5d8215c
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions mod/chat/lib.php
Expand Up @@ -426,37 +426,6 @@ function chat_cron () {
return true;
}

/**
* Returns the users with data in one chat
* (users with records in chat_messages, students)
*
* @todo: deprecated - to be deleted in 2.2
*
* @param int $chatid
* @param int $groupid
* @return array
*/
function chat_get_participants($chatid, $groupid=0) {
global $DB;

$params = array('groupid'=>$groupid, 'chatid'=>$chatid);

if ($groupid) {
$groupselect = " AND (c.groupid=:groupid OR c.groupid='0')";
} else {
$groupselect = "";
}

//Get students
$students = $DB->get_records_sql("SELECT DISTINCT u.id, u.id
FROM {user} u, {chat_messages} c
WHERE c.chatid = :chatid $groupselect
AND u.id = c.userid", $params);

//Return students array (it contains an array of unique users)
return ($students);
}

/**
* This standard function will check all instances of this module
* and make sure there are up-to-date events created for each of them.
Expand Down

0 comments on commit 5d8215c

Please sign in to comment.