From a2d2a11d4466a979dd269e750442a06eb010cbc3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 3 Sep 2022 14:41:53 +0200 Subject: [PATCH] Drop support for soju.im/read It's been superseded by draft/read-marker. --- components/app.js | 2 -- lib/client.js | 17 +++-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/components/app.js b/components/app.js index 2eacfc2..abf9abd 100644 --- a/components/app.js +++ b/components/app.js @@ -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=")) { diff --git a/lib/client.js b/lib/client.js index 8afe44f..7907015 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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], }); }