Mercurial Hosting > chat
diff src/add_post.js.luan @ 15:8b8905f63d80
add get_chats
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 03 Nov 2024 17:36:49 -0700 |
parents | 9f45d32670ae |
children | 82b55186a4a0 |
line wrap: on
line diff
--- a/src/add_post.js.luan Fri Nov 01 11:22:01 2024 -0600 +++ b/src/add_post.js.luan Sun Nov 03 17:36:49 2024 -0700 @@ -1,5 +1,6 @@ local Luan = require "luan:Luan.luan" local error = Luan.error +local ipairs = Luan.ipairs or error() local Time = require "luan:Time.luan" local time_now = Time.now or error() local Parsers = require "luan:Parsers.luan" @@ -16,6 +17,8 @@ local new_post = Post.new or error() local Shared = require "site:/lib/Shared.luan" local post_html = Shared.post_html or error() +local Utils = require "site:/lib/Utils.luan" +local base_url = Utils.base_url or error() return function() @@ -39,4 +42,10 @@ local html = `post_html(post)` local js = "added("..json_string(html)..")" chat.http_push(js) + js = "getChats('"..chat.id.."')" + local base = base_url().."/user/" + for _, user_id in ipairs(chat.user_ids) do + local url = base..user_id + Http.push(url,js) + end end