Compare commits
7 Commits
v1.0.0-bet
...
v1.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bcd9d3607 | ||
|
|
e4ebf5eb80 | ||
|
|
1428ec4d49 | ||
|
|
839e46360e | ||
|
|
d0064dd647 | ||
|
|
b9693d53ec | ||
|
|
f6ba40046f |
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user