CLN - remove notification debug command

This commit is contained in:
smx.pusha
2026-08-10 17:53:17 +02:00
parent bc308f0f69
commit a2e227d624
4 changed files with 0 additions and 88 deletions
-5
View File
@@ -19,11 +19,6 @@ Config.Phone = {
DeviceName = "iFruit Phone",
}
Config.NotificationTest = {
Command = "phonenotifytest",
AdminGroups = { "admin" },
}
Config.Security = {
PasscodePepperConvar = "sky_phone_passcode_pepper",
MaximumAttempts = 5,
-1
View File
@@ -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',
-4
View File
@@ -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)
-78
View File
@@ -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)