Mercurial Hosting > chat
changeset 54:1d724f187cff
minor fix
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 03 Mar 2025 21:19:12 -0700 |
parents | 9298b04607ae |
children | d21ae4920aac |
files | src/added.js.luan src/chat.js |
diffstat | 2 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/added.js.luan Mon Mar 03 21:19:12 2025 -0700 @@ -0,0 +1,15 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local Http = require "luan:http/Http.luan" +local User = require "site:/lib/User.luan" +local current_user = User.current or error() +local Chat = require "site:/lib/Chat.luan" +local get_chat_by_id = Chat.get_by_id or error() + + +return function() + local user = current_user() or error() + local chat = Http.request.parameters.chat or error() + chat = get_chat_by_id(chat) or error() + chat.read(user) +end
--- a/src/chat.js Mon Mar 03 19:39:30 2025 -0700 +++ b/src/chat.js Mon Mar 03 21:19:12 2025 -0700 @@ -152,6 +152,7 @@ input.insertAdjacentHTML('beforebegin',html); fixPosts(); input.scrollIntoView({block: 'end'}); + ajax(`added.js?chat=${currentChatId}`); if( document.hasFocus() ) ajax('active.js'); }