<commit_before><?php
namespace Minds\Helpers\Campaigns;

use Minds\Core;
use Minds\Helpers;

class DailyRewards
{
    public static function reward()
    {
        $cacher = Core\Data\cache\factory::build('apcu');
        if ($cacher->get('rewarded:' . Core\Session::getLoggedinUser()->guid) == true) {
            return;
        }

        //CAMPAIGN:: Reward 10 points per day if a user opens their app
        $db = new Core\Data\Call('entities_by_time');
        $ts = Helpers\Analytics::buildTS("day", time());
        $row = $db->getRow("analytics:rewarded:day:$ts", array('offset'=>Core\Session::getLoggedinUser()->guid, 'limit'=>1));
        if (!$row || key($row) != Core\Session::getLoggedinUser()->guid) {
            $db->insert("analytics:rewarded:day:$ts", array(Core\Session::getLoggedinUser()->guid => time()));

            Helpers\Wallet::createTransaction(Core\Session::getLoggedinUser()->guid, 10, Core\Session::getLoggedinUser()->guid, "Daily login reward.");
            $message = "You have received 10 points as a daily login reward.  Log back in again tomorrow to receive more points!";
            Core\Events\Dispatcher::trigger('notification', 'dailyReward', array(
              'to'=>array(Core\Session::getLoggedinUser()->guid),
              'from' => 100000000000000519,
              'notification_view' => 'custom_message',
              'params' => array('message'=>$message),
              'message'=>$message
              ));
        }
        $cacher->set('rewarded:' . Core\Session::getLoggedinUser()->guid, true, strtotime('tomorrow', time()) - time());
    }
}<commit_msg>(feat): bump daily reward points to 50<commit_after><?php
namespace Minds\Helpers\Campaigns;

use Minds\Core;
use Minds\Helpers;

class DailyRewards
{
    public static function reward()
    {
        $cacher = Core\Data\cache\factory::build('apcu');
        if ($cacher->get('rewarded:' . Core\Session::getLoggedinUser()->guid) == true) {
            return;
        }

        //CAMPAIGN:: Reward 10 points per day if a user opens their app
        $db = new Core\Data\Call('entities_by_time');
        $ts = Helpers\Analytics::buildTS("day", time());
        $row = $db->getRow("analytics:rewarded:day:$ts", array('offset'=>Core\Session::getLoggedinUser()->guid, 'limit'=>1));
        if (!$row || key($row) != Core\Session::getLoggedinUser()->guid) {
            $db->insert("analytics:rewarded:day:$ts", array(Core\Session::getLoggedinUser()->guid => time()));

            Helpers\Wallet::createTransaction(Core\Session::getLoggedinUser()->guid, 50, Core\Session::getLoggedinUser()->guid, "Daily login reward.");
            $message = "You have received 50 points as a daily login reward.  Log back in again tomorrow to receive more points!";
            Core\Events\Dispatcher::trigger('notification', 'dailyReward', array(
              'to'=>array(Core\Session::getLoggedinUser()->guid),
              'from' => 100000000000000519,
              'notification_view' => 'custom_message',
              'params' => array('message'=>$message),
              'message'=>$message
              ));
        }
        $cacher->set('rewarded:' . Core\Session::getLoggedinUser()->guid, true, strtotime('tomorrow', time()) - time());
    }
}
{'fraction_non_alphanumeric': 0.17163033466380104, 'fraction_numerical': 0.01596561252686521, 'mean_word_length': 3.0775969962453065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3726289', 'n_tokens_mistral': 1004, 'n_tokens_neox': 954, 'n_words': 190}