mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
ENH - expose Feather bookmarks on profiles
This commit is contained in:
@@ -124,6 +124,7 @@ local server_callbacks = {
|
||||
"feather:connections",
|
||||
"feather:remove-connection",
|
||||
"feather:profile",
|
||||
"feather:bookmarks",
|
||||
"feather:thread",
|
||||
"feather:activities",
|
||||
"feather:mark-activities",
|
||||
|
||||
@@ -552,6 +552,19 @@ Bridge.Callbacks.Register("sky_phone:feather:profile", function(source, data)
|
||||
} }
|
||||
end)
|
||||
|
||||
Bridge.Callbacks.Register("sky_phone:feather:bookmarks", function(source)
|
||||
local profile, error_response = require_profile(source)
|
||||
if not profile then return error_response end
|
||||
local bookmarked = list_posts(
|
||||
tonumber(profile.id),
|
||||
"EXISTS(SELECT 1 FROM `sky_phone_feather_reactions` saved WHERE saved.`profile_id` = ? AND saved.`post_id` = fp.`id` AND saved.`kind` = 'bookmark')",
|
||||
{ profile.id },
|
||||
"fp.`created_at` DESC",
|
||||
0
|
||||
)
|
||||
return { success = true, data = bookmarked }
|
||||
end)
|
||||
|
||||
Bridge.Callbacks.Register("sky_phone:feather:thread", function(source, data)
|
||||
local profile, error_response = require_profile(source)
|
||||
if not profile then return error_response end
|
||||
|
||||
Reference in New Issue
Block a user