Compare commits

..

No commits in common. "eb1284060ab9759684f9a16901caa5b12960114f" and "6b4709d01182da51bcfec33b7922f871953599cc" have entirely different histories.

2 changed files with 6 additions and 4 deletions

View File

@ -69,9 +69,10 @@ class ChannelMessageService(BaseService):
"color": user["color"],
}
)
context['message'] = whitelist_attributes(context['message'])
try:
template = self.app.jinja2_env.get_template("message.html")
model["html"] = whitelist_attributes(template.render(**context))
model["html"] = template.render(**context)
except Exception as ex:
print(ex, flush=True)
@ -117,6 +118,7 @@ class ChannelMessageService(BaseService):
async def save(self, model):
context = {}
context.update(model.record)
context['message'] = whitelist_attributes(context['message'])
user = await self.app.services.user.get(model["user_uid"])
context.update(
{
@ -127,7 +129,7 @@ class ChannelMessageService(BaseService):
}
)
template = self.app.jinja2_env.get_template("message.html")
model["html"] = whitelist_attributes(template.render(**context))
model["html"] = template.render(**context)
return await super().save(model)
async def offset(self, channel_uid, page=0, timestamp=None, page_size=30):

View File

@ -12,7 +12,7 @@ function showTerm(options){
class StarField {
constructor({ count = 50, container = document.body } = {}) {
constructor({ count = 100, container = document.body } = {}) {
this.container = container;
this.starCount = count;
this.stars = [];
@ -567,7 +567,7 @@ const count = Array.from(messages).filter(el => el.textContent.trim() === text).
const starField = new StarField({starCount: 50});
const starField = new StarField({starCount: 100});
app.starField = starField;
class DemoSequence {