7 Commits

Author SHA1 Message Date
Simon Ser
1bcd9d3607 ci: deploy to new server 2022-07-09 12:26:39 +02:00
Simon Ser
e4ebf5eb80 ci: fix deploy host
emersion.fr is now an alias for the new server. gamja hasn't been
migrated yet.
2022-07-08 21:24:09 +02:00
Simon Ser
1428ec4d49 Add support for draft/read-marker
References: https://github.com/ircv3/ircv3-specifications/pull/489
2022-07-01 13:35:27 +02:00
Arik
839e46360e Use monospace on <input> too
It looks like having "font-family: monospace" on <body> doesn't set it
for <input> too.
2022-07-01 13:34:22 +02:00
Simon Ser
d0064dd647 components/buffer: show disclaimer for +draft/channel-context messages 2022-06-28 15:55:35 +02:00
delthas
b9693d53ec Support @+draft/channel-context
See: https://github.com/ircv3/ircv3-specifications/pull/498
2022-06-28 15:33:38 +02:00
Simon Ser
f6ba40046f components/buffer-header: fix duplicate settings button 2022-06-28 15:11:48 +02:00
6 changed files with 48 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ packages:
sources:
- https://git.sr.ht/~emersion/gamja
secrets:
- 5874ac5a-905e-4596-a117-fed1401c60ce # deploy SSH key
- 77c7956b-003e-44f7-bb5c-2944b2047654 # deploy SSH key
tasks:
- setup: |
cd gamja
@@ -16,4 +16,4 @@ tasks:
[ "$(git rev-parse HEAD)" = "$(git rev-parse origin/master)" ] || complete-build
rsync --rsh="ssh -o StrictHostKeyChecking=no" -rP \
--delete --exclude=config.json \
. deploy@emersion.fr:/srv/http/gamja
. deploy@sheeta.emersion.fr:/srv/http/gamja

View File

@@ -414,17 +414,14 @@ export default class App extends Component {
}
sendReadReceipt(client, storedBuffer) {
if (!client.caps.enabled.has("soju.im/read")) {
if (!client.supportsReadMarker()) {
return;
}
let readReceipt = storedBuffer.receipts[ReceiptType.READ];
if (storedBuffer.name === "*" || !readReceipt) {
return;
}
client.send({
command: "READ",
params: [storedBuffer.name, "timestamp="+readReceipt.time],
});
client.setReadMarker(storedBuffer.name, readReceipt.time);
}
switchBuffer(id) {
@@ -745,7 +742,12 @@ export default class App extends Component {
if (client.cm(msg.prefix.name) === client.cm(client.serverPrefix.name)) {
target = SERVER_BUFFER;
} else {
target = msg.prefix.name;
let context = msg.tags['+draft/channel-context'];
if (context && client.isChannel(context) && State.getBuffer(this.state, { server: serverID, name: context })) {
target = context;
} else {
target = msg.prefix.name;
}
}
}
if (msg.command === "NOTICE" && !State.getBuffer(this.state, { server: serverID, name: target })) {
@@ -865,6 +867,7 @@ export default class App extends Component {
case "CHATHISTORY":
case "ACK":
case "BOUNCER":
case "MARKREAD":
case "READ":
// Ignore these
return [];
@@ -1015,6 +1018,7 @@ export default class App extends Component {
this.autoOpenURL = null;
}
break;
case "MARKREAD":
case "READ":
target = msg.params[0];
let bound = msg.params[1];
@@ -1223,11 +1227,8 @@ export default class App extends Component {
});
client.monitor(target);
if (client.caps.enabled.has("soju.im/read")) {
client.send({
command: "READ",
params: [target],
});
if (client.supportsReadMarker()) {
client.fetchReadMarker(target);
}
}

View File

@@ -113,7 +113,6 @@ export default function BufferHeader(props) {
} else {
if (fullyConnected) {
actions.push(joinButton);
actions.push(settingsButton);
} else if (props.server.status === ServerStatus.DISCONNECTED) {
actions.push(reconnectButton);
}

View File

@@ -146,6 +146,10 @@ class LogLine extends Component {
}
}
if (msg.tags["+draft/channel-context"]) {
content = html`<em>(only visible to you)</em> ${content}`;
}
if (msg.isHighlight) {
lineClass += " highlight";
}

View File

@@ -1015,4 +1015,32 @@ export default class Client extends EventTarget {
return { message: msg.params[2] };
});
}
supportsReadMarker() {
return this.caps.enabled.has("draft/read-marker") || this.caps.enabled.has("soju.im/read");
}
_markReadCmd() {
if (this.caps.enabled.has("draft/read-marker")) {
return "MARKREAD";
} else if (this.caps.enabled.has("soju.im/read")) {
return "READ";
} else {
return null;
}
}
fetchReadMarker(target) {
this.send({
command: this._markReadCmd(),
params: [target],
});
}
setReadMarker(target, t) {
this.send({
command: this._markReadCmd(),
params: [target, "timestamp="+t],
});
}
}

View File

@@ -352,6 +352,8 @@ form input[type="url"],
form input[type="email"] {
box-sizing: border-box;
width: 100%;
font-family: inherit;
font-size: inherit;
}
a {