mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-04-13 09:59:52 +00:00
use vendor prefix for custom specs
This commit is contained in:
parent
211142586c
commit
8be16f12c6
4 changed files with 12 additions and 10 deletions
|
@ -37,9 +37,9 @@ If the server has any persistent history store for the type of message that is e
|
|||
|
||||
### Message deletion
|
||||
|
||||
To delete a message, clients send a `DELETEMSG` message to the channel or user that the original message was sent to. The message MUST have a `draft/delete-message` tag with the msgid to delete. The message MAY have a second parameter, which is the reason for deletion.
|
||||
To delete a message, clients send a `DELETEMSG` message to the channel or user that the original message was sent to. The message MUST have a `delete-message` tag with the msgid to delete. The message MAY have a second parameter, which is the reason for deletion.
|
||||
|
||||
Clients who receive a `DELETEMSG` with the `draft/delete-message` tag MUST remove all displayed content from the specified `msgid`. If the original message is ephemeral, clients SHOULD remove it entirely; otherwise they MUST replace the content with the deletion reason or a generic substitute.
|
||||
Clients who receive a `DELETEMSG` with the `delete-message` tag MUST remove all displayed content from the specified `msgid`. If the original message is ephemeral, clients SHOULD remove it entirely; otherwise they MUST replace the content with the deletion reason or a generic substitute.
|
||||
|
||||
Servers MUST ensure that the user requesting deletion has sufficient privileges to delete the specified message. Servers MUST remove the content of the original message from all persistent history stores, and MAY replace the content with the deletion reason or a generic deletion message if needed.
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ export class Client {
|
|||
["batch", ""],
|
||||
["draft/channel-rename", ""],
|
||||
["echo-message", ""],
|
||||
["reflectionircd.chat/edit-message", ""],
|
||||
["reflectionircd.chat/extended-invite", ""],
|
||||
["extended-join", ""],
|
||||
["invite-notify", ""],
|
||||
["labeled-response", ""],
|
||||
|
@ -202,7 +204,7 @@ export class Client {
|
|||
if (!this.checkIfRegistered() || !this.checkMinParams(message, 1))
|
||||
return;
|
||||
const targetChannel = this.getChannel(message.params[0]);
|
||||
const eventId = message.tags.get("draft/delete-message");
|
||||
const eventId = message.tags.get("reflectionircd.chat/delete-message");
|
||||
if (!this.user || !targetChannel || !eventId) return;
|
||||
if (!this.checkIfInChannel(targetChannel)) return;
|
||||
const data = {
|
||||
|
@ -587,8 +589,8 @@ export class Client {
|
|||
['account', 'account-tag'],
|
||||
['label', 'labeled-response'],
|
||||
['msgid', 'message-tags'],
|
||||
['draft/delete-message', 'draft/edit-message'],
|
||||
['draft/edit-message', 'draft/edit-message'],
|
||||
['reflectionircd.chat/delete-message', 'reflectionircd.chat/edit-message'],
|
||||
['reflectionircd.chat/edit-message', 'reflectionircd.chat/edit-message'],
|
||||
['time', 'server-time'],
|
||||
])
|
||||
const ourTags: Map<string, string> = new Map();
|
||||
|
|
|
@ -66,8 +66,8 @@ function encodeTag(value: string): string {
|
|||
function addToTags(key: string): boolean {
|
||||
const tagsToPass = [
|
||||
'batch',
|
||||
'draft/delete-message',
|
||||
'draft/edit-message',
|
||||
'reflectionircd.chat/delete-message',
|
||||
'reflectionircd.chat/edit-message',
|
||||
'label',
|
||||
]
|
||||
return (tagsToPass.includes(key) || key.startsWith('+'));
|
||||
|
|
|
@ -343,7 +343,7 @@ export class Server {
|
|||
const reason = content["reason"];
|
||||
this.clients.forEach(c => {
|
||||
if (c.enabledCaps.has('invite-notify')) {
|
||||
if (c.enabledCaps.has('draft/extended-invite')) {
|
||||
if (c.enabledCaps.has('reflectionircd.chat/extended-invite')) {
|
||||
c.sendMessage(sourceUser.getMask(), 'INVITE', [targetUser.nick, targetChannel.name, reason], messageTags)
|
||||
} else {
|
||||
c.sendMessage(sourceUser.getMask(), 'INVITE', [targetUser.nick, targetChannel.name], messageTags)
|
||||
|
@ -512,11 +512,11 @@ export class Server {
|
|||
}
|
||||
const reason = event["content"]?.["reason"] || "";
|
||||
const tags: Map<string, string> = new Map();
|
||||
tags.set('draft/delete-message', event["redacts"]);
|
||||
tags.set('reflectionircd.chat/delete-message', event["redacts"]);
|
||||
tags.set('account', sourceUser.accountName);
|
||||
tags.set('time', new Date(event["origin_server_ts"]).toISOString())
|
||||
this.clients.forEach((client) => {
|
||||
if (client.enabledCaps.has("draft/edit-message"))
|
||||
if (client.enabledCaps.has("reflectionircd.chat/edit-message"))
|
||||
client.sendMessage(sourceUser.getMask(), 'DELETEMSG', [targetChannel.name, reason], tags);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue