Modify Correspondence::sendMessage behaviour because current behaviour is useless and confusing

This commit is contained in:
Alma Armas 2020-07-18 07:47:42 +00:00
parent 59f831a3f4
commit 1cfb680a2c

View file

@ -110,7 +110,7 @@ class Correspondence
} }
/** /**
* Send message as user, who is currently logged in. * Send message.
* *
* @deprecated * @deprecated
* @returns Message|false - resulting message, or false in case of non-successful transaction * @returns Message|false - resulting message, or false in case of non-successful transaction
@ -122,7 +122,6 @@ class Correspondence
$ids = [$this->correspondents[0]->getId(), $this->correspondents[1]->getId()]; $ids = [$this->correspondents[0]->getId(), $this->correspondents[1]->getId()];
$classes = [get_class($this->correspondents[0]), get_class($this->correspondents[1])]; $classes = [get_class($this->correspondents[0]), get_class($this->correspondents[1])];
if(!in_array($user->getId(), $ids)) return false;
if($ids[1] === $user->getId() && !$dontReverse) { if($ids[1] === $user->getId() && !$dontReverse) {
$ids = array_reverse($ids); $ids = array_reverse($ids);
$classes = array_reverse($classes); $classes = array_reverse($classes);