added not subscribed page, added premium inbox

This commit is contained in:
Gitea
2025-05-06 07:21:39 +05:30
parent 86e452deac
commit 671cb6212d
12 changed files with 603 additions and 22 deletions

View File

@@ -35,6 +35,12 @@ class Premium extends Model
public static function fetchMessages($email, $type = 'to', $deleted = []): array
{
if ($email == null) {
return [
"data" => [],
"notifications" => []
];
}
$allowed = explode(',', 'doc,docx,xls,xlsx,ppt,pptx,xps,pdf,dxf,ai,psd,eps,ps,svg,ttf,zip,rar,tar,gzip,mp3,mpeg,wav,ogg,jpeg,jpg,png,gif,bmp,tif,webm,mpeg4,3gpp,mov,avi,mpegs,wmv,flx,txt');
$connection = self::connectMailBox();
@@ -91,6 +97,7 @@ class Premium extends Model
$obj['date'] = $date->format(json_decode(config('app.settings.configuration_settings'))->date_format ?? 'd M Y h:i A');
$obj['datediff'] = $datediff->diffForHumans();
$obj['id'] = $message->getNumber();
$obj['size'] = $message->getSize();
$obj['content'] = $content;
$obj['contentText'] = $contentText;
$obj['attachments'] = [];
@@ -191,6 +198,15 @@ class Premium extends Model
Cookie::queue('email', $email, 43800);
}
}
public static function setEmailP($email): void
{
$usageLogs = UsageLog::where(['user_id' => auth()->user()->id])->first();
$emails = $usageLogs->emails_created_history;
if (is_array($emails) && in_array($email, $emails)) {
Cookie::queue('email', $email, 43800);
}
}
public static function removeEmail($email): void
{
$emails = self::getEmails();
@@ -287,14 +303,14 @@ class Premium extends Model
if ($domain == "gmail.com") {
$rd = mt_rand(0,1);
if ($rd == 0) {
$email = $zemail->generateRandomGmail();
$email = $zemail->generateRandomGmail(false);
} else {
$email = $zemail->getRandomGmailUser().'+'.$zemail->generateRandomUsername().'@gmail.com';
}
} elseif ($domain == "googlemail.com") {
$rd = mt_rand(0,1);
if ($rd == 0) {
$email = $zemail->generateRandomGmail();
$email = $zemail->generateRandomGmail(false);
} else {
$email = $zemail->getRandomGmailUser().'+'.$zemail->generateRandomUsername().'@googlemail.com';
}