Drop support for soju.im/read

It's been superseded by draft/read-marker.
This commit is contained in:
Simon Ser 2022-09-03 14:41:53 +02:00
parent e6618c8a1f
commit a2d2a11d44
2 changed files with 3 additions and 16 deletions

View file

@ -880,7 +880,6 @@ export default class App extends Component {
case "ACK":
case "BOUNCER":
case "MARKREAD":
case "READ":
// Ignore these
return [];
default:
@ -1031,7 +1030,6 @@ export default class App extends Component {
}
break;
case "MARKREAD":
case "READ":
target = msg.params[0];
let bound = msg.params[1];
if (bound === "*" || !bound.startsWith("timestamp=")) {

View file

@ -24,7 +24,6 @@ const permanentCaps = [
"draft/read-marker",
"soju.im/bouncer-networks",
"soju.im/read",
];
const RECONNECT_MIN_DELAY_MSEC = 10 * 1000; // 10s
@ -1023,29 +1022,19 @@ export default class Client extends EventTarget {
}
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;
}
return this.caps.enabled.has("draft/read-marker");
}
fetchReadMarker(target) {
this.send({
command: this._markReadCmd(),
command: "MARKREAD",
params: [target],
});
}
setReadMarker(target, t) {
this.send({
command: this._markReadCmd(),
command: "MARKREAD",
params: [target, "timestamp="+t],
});
}