messages: show a bot icon next to a bot's nick in the log

A sender with +B (member.bot, from the WHO 'B' flag) now gets a robot badge after
their nick — inside the <nick> on the mIRC lines (<Pulsar🤖>) and after the nick in
the grouped view. Grayscaled in yomirc to stay monochrome.
This commit is contained in:
Jean Chevronnet 2026-07-05 13:29:30 +00:00
parent 42a59f87f8
commit b716663a4f
No known key found for this signature in database
3 changed files with 9 additions and 3 deletions

View file

@ -46,6 +46,7 @@ function MsgRow({ m, cont }: { m: ChatMessage; cont: boolean }) {
const togglePin = useActiveChat((s) => s.togglePin);
const pinned = useActiveChat((s) => s.pins[s.active]?.some((p) => p.id === m.id) ?? false);
const isOper = useActiveChat((s) => !!s.buffers[s.active]?.members[m.from]?.oper);
const isBot = useActiveChat((s) => !!s.buffers[s.active]?.members[m.from]?.bot);
const linkPreviews = useActiveChat((s) => s.prefs.linkPreviews);
// Avatars resolve by ACCOUNT. Live messages carry the account tag, but
// chathistory-replayed ones (e.g. on a fresh mobile join) often don't — so
@ -76,7 +77,9 @@ function MsgRow({ m, cont }: { m: ChatMessage; cont: boolean }) {
<div data-mid={m.id} className={`mircline ${m.kind === 'action' ? 'mircline--action' : ''} ${m.redacted ? 'is-redacted' : ''}`}>
<span className="mircline__time">[{fmtTime(m.ts)}]</span>{' '}
<button className="mircline__nick" style={nickStyle} onClick={() => openUser(m.from)}>
{m.kind === 'action' ? `* ${m.from}` : `<${m.from}>`}
{m.kind === 'action' ? '* ' : '<'}{m.from}
{isBot && <span className="nick-bot" aria-label="bot">🤖</span>}
{m.kind !== 'action' && '>'}
</button>{' '}
<span className="mircline__txt">
{m.redacted ? `${t('messages.deleted')}` : formatIrc(m.text, m.self, linkPreviews)}
@ -111,7 +114,7 @@ function MsgRow({ m, cont }: { m: ChatMessage; cont: boolean }) {
<div className="group__body">
{!cont && (
<div className="group__head">
<button className="group__nick" style={{ color: isOper ? IRCOP_COLOR : nickColor(m.from) }} onClick={() => openUser(m.from)}>{m.from}</button>
<button className="group__nick" style={{ color: isOper ? IRCOP_COLOR : nickColor(m.from) }} onClick={() => openUser(m.from)}>{m.from}{isBot && <span className="nick-bot" aria-label="bot">🤖</span>}</button>
<span className="group__time">{fmtTime(m.ts)}</span>
</div>
)}

View file

@ -654,6 +654,8 @@ html[data-actions="off"] .msg-actions { display: none; }
/* bot tag */
.member__bot { margin-left: auto; flex: none; font-size: .58rem; font-weight: 800; letter-spacing: .06em; padding: .1rem .35rem; border-radius: 5px; background: #e8ecff; color: #4458c8; }
/* Bot icon after a bot's nick in the message list. */
.nick-bot { font-size: .82em; margin-left: .15em; vertical-align: baseline; }
/* visible IRC operators (no +H) — IRCop nick colour (IRC colour 10), consistent everywhere */

View file

@ -110,7 +110,8 @@
[data-theme^="yomirc"] .appbar__act,
[data-theme^="yomirc"] .composer__emoji,
[data-theme^="yomirc"] .composer__fmtbtn,
[data-theme^="yomirc"] .composer__add { filter: grayscale(1); opacity: .8; }
[data-theme^="yomirc"] .composer__add,
[data-theme^="yomirc"] .nick-bot { filter: grayscale(1); opacity: .8; }
[data-theme^="yomirc"] .topbar__search:hover,
[data-theme^="yomirc"] .tab:hover .tab__ic,
[data-theme^="yomirc"] .appbar__act:hover,