mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
ENH - add Flare account controls and photo overview
Use the centered SkyNavbar surface back action, expose every owned profile photo as a selectable thumbnail, and add confirmed Sky Cloud sign-out plus server-authoritative Flare account deletion. Keep client, server, localization, stateful mocks, and regression coverage aligned.
This commit is contained in:
@@ -467,6 +467,42 @@ Bridge.Callbacks.Register("sky_phone:flare:bootstrap", function(source)
|
||||
return { success = true, data = bootstrap(account.id) }
|
||||
end)
|
||||
|
||||
Bridge.Callbacks.Register("sky_phone:flare:delete-profile", function(source)
|
||||
if not SkyPhone.AllowOperation(source, "flare_profile_delete", 3, 60) then
|
||||
return { success = false, error = "rate_limited" }
|
||||
end
|
||||
local account, error_response = SkyPhone.RequireAccount(source)
|
||||
if not account then
|
||||
return error_response
|
||||
end
|
||||
if not load_profile(account.id) then
|
||||
return { success = false, error = "profile_not_found" }
|
||||
end
|
||||
if not Bridge.Database.Transaction({
|
||||
{
|
||||
query = [[
|
||||
DELETE FROM `sky_phone_flare_matches`
|
||||
WHERE `account_a_id` = ? OR `account_b_id` = ?
|
||||
]],
|
||||
params = { account.id, account.id },
|
||||
},
|
||||
{
|
||||
query = [[
|
||||
DELETE FROM `sky_phone_flare_swipes`
|
||||
WHERE `swiper_account_id` = ? OR `target_account_id` = ?
|
||||
]],
|
||||
params = { account.id, account.id },
|
||||
},
|
||||
{
|
||||
query = "DELETE FROM `sky_phone_flare_profiles` WHERE `account_id` = ?",
|
||||
params = { account.id },
|
||||
},
|
||||
}) then
|
||||
return { success = false, error = "request_failed" }
|
||||
end
|
||||
return { success = true }
|
||||
end)
|
||||
|
||||
Bridge.Callbacks.Register("sky_phone:flare:save-profile", function(source, data)
|
||||
if not SkyPhone.AllowOperation(source, "flare_profile", 12, 60) then
|
||||
return { success = false, error = "rate_limited" }
|
||||
|
||||
Reference in New Issue
Block a user