Add support for draft/read-marker
References: https://github.com/ircv3/ircv3-specifications/pull/489
This commit is contained in:
@@ -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