From a2e227d624b72001c8c5dd7b45e34e1b62b5760a Mon Sep 17 00:00:00 2001 From: "smx.pusha" <139338836+smxpusha@users.noreply.github.com> Date: Mon, 10 Aug 2026 17:53:17 +0200 Subject: [PATCH] CLN - remove notification debug command --- sky_phone/config/config.lua | 5 -- sky_phone/fxmanifest.lua | 1 - sky_phone/source/client/main.lua | 4 -- sky_phone/source/server/debug.lua | 78 ------------------------------- 4 files changed, 88 deletions(-) delete mode 100644 sky_phone/source/server/debug.lua diff --git a/sky_phone/config/config.lua b/sky_phone/config/config.lua index 45504cd..2e0d2d7 100644 --- a/sky_phone/config/config.lua +++ b/sky_phone/config/config.lua @@ -19,11 +19,6 @@ Config.Phone = { DeviceName = "iFruit Phone", } -Config.NotificationTest = { - Command = "phonenotifytest", - AdminGroups = { "admin" }, -} - Config.Security = { PasscodePepperConvar = "sky_phone_passcode_pepper", MaximumAttempts = 5, diff --git a/sky_phone/fxmanifest.lua b/sky_phone/fxmanifest.lua index 1ce33a2..ff3f1f9 100644 --- a/sky_phone/fxmanifest.lua +++ b/sky_phone/fxmanifest.lua @@ -53,7 +53,6 @@ server_scripts { 'source/bridge/server/inventory/*.lua', 'source/server/db_migrate.lua', 'source/server/phone.lua', - 'source/server/debug.lua', 'source/server/sim.lua', 'source/server/calls.lua', 'source/server/media.lua', diff --git a/sky_phone/source/client/main.lua b/sky_phone/source/client/main.lua index 2aa3b7d..6ca456d 100644 --- a/sky_phone/source/client/main.lua +++ b/sky_phone/source/client/main.lua @@ -617,10 +617,6 @@ RegisterNetEvent("sky_phone:billing:new", function(data) SendNUIMessage({ type = "billing:new", data = data }) end) -RegisterNetEvent("sky_phone:notification:test", function(data) - SendNUIMessage({ type = "notification:show", data = data }) -end) - RegisterNetEvent("sky_phone:messages:changed", function(data) SendNUIMessage({ type = "messages:changed", data = data }) end) diff --git a/sky_phone/source/server/debug.lua b/sky_phone/source/server/debug.lua deleted file mode 100644 index 2a48783..0000000 --- a/sky_phone/source/server/debug.lua +++ /dev/null @@ -1,78 +0,0 @@ -Bridge.Database.AfterMigration("sky_phone", function() -RegisterCommand(Config.NotificationTest.Command, function(source) - if source == 0 then - print(("[sky_phone] /%s must be used by an in-game admin."):format(Config.NotificationTest.Command)) - return - end - - if not Bridge.Framework.HasAdminGroup(source, Config.NotificationTest.AdminGroups) then - Bridge.Debug( - "warn", - "[sky_phone] Source %s attempted to use the notification test command without an admin group.", - tostring(source) - ) - return - end - - local slots = Bridge.Inventory.GetSlotsWithItem(source, Config.Phone.Item) - local slot = slots[1] - if not slot then - Bridge.Debug( - "warn", - "[sky_phone] Notification test failed because source %s has no phone item.", - tostring(source) - ) - TriggerClientEvent("sky_phone:device:error", source, "phone_slot_missing") - return - end - - local imei, device_error = SkyPhone.EnsureDevice(source, slot) - if not imei then - Bridge.Debug( - "warn", - "[sky_phone] Notification test could not resolve a device for source %s: %s.", - tostring(source), - tostring(device_error) - ) - TriggerClientEvent("sky_phone:device:error", source, device_error or "request_failed") - return - end - - local device = SkyPhone.LoadDevice(imei) - if not device then - Bridge.Debug( - "error", - "[sky_phone] Notification test could not load device %s for source %s.", - imei, - tostring(source) - ) - TriggerClientEvent("sky_phone:device:error", source, "request_failed") - return - end - - local settings = Bridge.Database.Query([[ - SELECT `payload` - FROM `sky_phone_device_data` - WHERE `device_imei` = ? AND `namespace` = 'settings' - LIMIT 1 - ]], { imei })[1] - - TriggerClientEvent("sky_phone:notification:test", source, { - appId = "messages", - title = "Notification Test", - text = "This is a test notification.", - device = { - imei = imei, - name = device.device_name, - settings = settings and settings.payload or nil, - }, - }) - - Bridge.Debug( - "info", - "[sky_phone] Sent a test notification to source %s on device %s.", - tostring(source), - imei - ) -end, false) -end)