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

View File

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