forked from GNUsocial/gnu-social
Move AlreadyFulfilled check to Fave::addNew
This commit is contained in:
@@ -14,17 +14,6 @@ class FavCommand extends Command
|
||||
{
|
||||
$notice = $this->getNotice($this->other);
|
||||
|
||||
$fave = new Fave();
|
||||
$fave->user_id = $this->user->id;
|
||||
$fave->notice_id = $notice->id;
|
||||
$fave->find();
|
||||
|
||||
if ($fave->fetch()) {
|
||||
// TRANS: Error message text shown when a favorite could not be set because it has already been favorited.
|
||||
$channel->error($this->user, _('Could not create favorite: Already favorited.'));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$fave = Fave::addNew($this->user->getProfile(), $notice);
|
||||
} catch (Exception $e) {
|
||||
|
Reference in New Issue
Block a user