MDL-63884 core_message: fix for get_conversations legacy adapter code

This code also tries to adapt other conversation types, but it should
only support individual conversations, where we know members exist.
This commit is contained in:
Jake Dallimore
2018-11-09 17:59:55 +08:00
parent 9cef5491fb
commit d76029110b
+4
View File
@@ -540,6 +540,10 @@ class helper {
// Transform new data format back into the old format, just for BC during the deprecation life cycle.
$tmp = [];
foreach ($conversations as $id => $conv) {
// Only individual conversations were supported in legacy messaging.
if ($conv->type != \core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL) {
continue;
}
$data = new \stdClass();
// The logic for the 'other user' is as follows:
// If a conversation is of type 'individual', the other user is always the member who is not the current user.