Mercurial Hosting > chat
diff src/lib/User.luan @ 46:42b741a1d5c6
add username
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 28 Feb 2025 19:25:12 -0700 |
parents | 818697418dbe |
children | 7b339b1ccd11 |
line wrap: on
line diff
--- a/src/lib/User.luan Fri Feb 28 14:37:11 2025 -0700 +++ b/src/lib/User.luan Fri Feb 28 19:25:12 2025 -0700 @@ -11,6 +11,8 @@ local random = Math.random or error() local Table = require "luan:Table.luan" local concat = Table.concat or error() +local Html = require "luan:Html.luan" +local html_encode = Html.encode or error() local Lucene = require "luan:lucene/Lucene.luan" local lucene_quote = Lucene.quote or error() local Http = require "luan:http/Http.luan" @@ -37,6 +39,7 @@ notify_email = doc.notify_email multi_notify = doc.multi_notify=="true" voice_url = doc.voice_url + name = doc.name } end @@ -50,6 +53,7 @@ notify_email = user.notify_email multi_notify = user.multi_notify and "true" or nil voice_url = user.voice_url + name = user.name } end @@ -107,6 +111,10 @@ return set_to_list(user_ids) end + function user.name_html() + return html_encode(user.name or user.email) + end + return user end