ADD - mail app

This commit is contained in:
Eichenholz
2026-08-04 12:25:15 +02:00
parent 8090dbd5ab
commit 2066d31f71
27 changed files with 3063 additions and 73 deletions
+38
View File
@@ -1,6 +1,24 @@
local is_open = false
local notification_focus = false
local mail_callbacks = {
"mail:register",
"mail:login",
"mail:logout",
"mail:counts",
"mail:list",
"mail:get",
"mail:get-draft",
"mail:save-draft",
"mail:delete-draft",
"mail:send",
"mail:set-read",
"mail:trash",
"mail:restore",
"mail:delete-forever",
"mail:empty-trash",
}
local function get_locale()
return Locales[Sky.Config.locale] or Locales["en"]
end
@@ -64,6 +82,26 @@ RegisterNUICallback("notification:focus", function(data, cb)
cb({ success = true })
end)
for _, callback_name in ipairs(mail_callbacks) do
RegisterNUICallback(callback_name, function(data, cb)
local result = Sky.Cb.Trigger("sky_phone:" .. callback_name, data)
if result then
cb(result)
return
end
cb({ success = false, error = "request_failed" })
end)
end
RegisterNetEvent("sky_phone:mail:changed", function(data)
SendNUIMessage({ type = "mail:changed", data = data })
end)
RegisterNetEvent("sky_phone:mail:new", function(data)
SendNUIMessage({ type = "mail:new", data = data })
end)
CreateThread(function()
TriggerEvent("chat:addSuggestion", "/" .. Config.Command, get_locale().CommandDescription)
end)