Send WHO query when opening nick buffer
This commit is contained in:
parent
74b720c131
commit
57ed3a13a3
3 changed files with 43 additions and 9 deletions
|
@ -1,20 +1,34 @@
|
|||
import { html, Component } from "/lib/index.js";
|
||||
import { BufferType } from "/state.js";
|
||||
|
||||
export default function BufferHeader(props) {
|
||||
var topic = null;
|
||||
if (props.buffer.topic) {
|
||||
topic = html`<span class="topic">${props.buffer.topic}</span>`;
|
||||
}
|
||||
|
||||
function handlePartClick(event) {
|
||||
event.preventDefault();
|
||||
props.onClose();
|
||||
}
|
||||
|
||||
var description = null;
|
||||
if (props.buffer.topic) {
|
||||
description = html`<span class="description">${props.buffer.topic}</span>`;
|
||||
} else if (props.buffer.who) {
|
||||
var who = props.buffer.who;
|
||||
description = html`<span class="description">${who.realname} (${who.username}@${who.hostname})</span>`;
|
||||
}
|
||||
|
||||
var closeText = "Close";
|
||||
switch (props.buffer.type) {
|
||||
case BufferType.SERVER:
|
||||
closeText = "Disconnect";
|
||||
break;
|
||||
case BufferType.CHANNEL:
|
||||
closeText = "Part";
|
||||
break;
|
||||
}
|
||||
|
||||
return html`
|
||||
${topic}
|
||||
${description}
|
||||
<span class="actions">
|
||||
<a href="#" onClick=${handlePartClick}>Part</a>
|
||||
<a href="#" onClick=${handlePartClick}>${closeText}</a>
|
||||
</span>
|
||||
`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue