From f6f29adacc408d86750820ac3a4bdf165d7b7f3f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 15 Jul 2021 13:16:42 -0700 Subject: [PATCH] Add a comment about avatar.js --- src/platform/web/ui/session/room/timeline/TextMessageView.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platform/web/ui/session/room/timeline/TextMessageView.js b/src/platform/web/ui/session/room/timeline/TextMessageView.js index ff674753..091947f0 100644 --- a/src/platform/web/ui/session/room/timeline/TextMessageView.js +++ b/src/platform/web/ui/session/room/timeline/TextMessageView.js @@ -54,6 +54,9 @@ function renderImage(imagePart) { } function renderPill(pillPart) { + // The classes and structure are borrowed from avatar.js; + // We don't call renderStaticAvatar because that would require + // an intermediate object that has getAvatarUrl etc. const classes = `avatar size-12 usercolor${pillPart.avatarColorNumber}`; const avatar = tag.div({class: classes}, text(pillPart.avatarInitials)); const children = renderParts(pillPart.children);