Mercurial Hosting > chat
diff src/lib/Chat.luan @ 33:e2b7f6393dab
add online
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 10 Nov 2024 19:57:14 -0700 |
parents | 9f45d32670ae |
children | 42b741a1d5c6 |
line wrap: on
line diff
--- a/src/lib/Chat.luan Sat Nov 09 21:41:11 2024 -0700 +++ b/src/lib/Chat.luan Sun Nov 10 19:57:14 2024 -0700 @@ -1,9 +1,6 @@ local Luan = require "luan:Luan.luan" local error = Luan.error local ipairs = Luan.ipairs or error() -local Table = require "luan:Table.luan" -local concat = Table.concat or error() -local is_empty = Table.is_empty or error() local Time = require "luan:Time.luan" local time_now = Time.now or error() local Http = require "luan:http/Http.luan" @@ -50,21 +47,6 @@ end ) end - function chat.other_users_email(user) - local User = require "site:/lib/User.luan" - local get_user_by_id = User.get_by_id or error() - - local my_id = user.id - local t = {} - for _, user_id in ipairs(chat.user_ids) do - if user_id ~= my_id then - local other_user = get_user_by_id(user_id) or error() - t[#t+1] = other_user.email - end - end - return concat( t, ", " ) - end - function chat.http_push(message) local url = base_url().."/chat/"..chat.id Http.push(url,message)