fix(habitica): Added method to record reward delivery

Signed-off-by: Stuart McCulloch Anderson's avatarStuart McCulloch Anderson <stuart@nxfifteen.me.uk>
parent 89f4a6ec
......@@ -379,4 +379,19 @@ class Rewards
return $returnRewards;
}
/**
* @param $rewardKey
*/
public function recordAwarded($rewardKey)
{
$this->getAppClass()->getDatabase()->insert($this->getAppClass()->getSetting("db_prefix", null, false) . "reward_queue", [
"fuid" => $this->getUserID(),
"state" => 'recorded',
"rmid" => NULL,
"reward" => NULL,
"rkey" => sha1($rewardKey)
]);
$this->getAppClass()->getErrorRecording()->postDatabaseQuery($this->getAppClass()->getDatabase(), ["METHOD" => __METHOD__, "LINE" => __LINE__]);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment