The example given here simply does not work.
socket.on_statuspresence(function(message)
local pressences = message.on_status_presence
if pressence then
-- todo: check if online
for _, presence in ipairs(presences)
pprint(presence.username .. " is online with status: '" .. presence.status .. "'")
end
end
end)
on_statuspresence() does not exist on socket. I was able to inspect the socket object and use on_status_presence_event() which works.
BUT the following also doesn’t work. There is an assertion error on user_ids.
local user_ids = { "<SomeUserId>", "<AnotherUserId>" }
local result = socket.status_follow(user_ids)
Upon inspecting the client source:
function M.status_follow(socket, user_ids, usernames, callback)
assert(socket)
assert(user_ids == nil or _G.type(user_ids) == 'string')
assert(usernames == nil or _G.type(usernames) == 'string')
socket.cid = socket.cid + 1
local message = {
cid = tostring(socket.cid),
status_follow = {
user_ids = user_ids,
usernames = usernames,
}
}
return socket_send(socket, message, callback)
end
The user_ids is expected to be nil or of type string.
Can someone help me figure this out please?