MDL-36941 core: added 'convhash' field to quickly get conversations
This commit is contained in:
@@ -293,6 +293,18 @@ class helper {
|
||||
return $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the conversation hash between users for easy look-ups in the DB.
|
||||
*
|
||||
* @param array $userids
|
||||
* @return string
|
||||
*/
|
||||
public static function get_conversation_hash(array $userids) {
|
||||
sort($userids);
|
||||
|
||||
return sha1(implode('-', $userids));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the cache key for the time created value of the last message between two users.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user