Msg delete and edit protocol and events
This commit is contained in:
@@ -194,6 +194,16 @@ export default class Enclave<P = Page> {
|
|||||||
this.forceRender();
|
this.forceRender();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case "MessageDeleted":
|
||||||
|
delete server.messages[msg.channel_id][msg.message_id];
|
||||||
|
this.forceRender();
|
||||||
|
return;
|
||||||
|
|
||||||
|
case "MessageEdited":
|
||||||
|
server.messages[msg.channel_id][msg.message.id] = msg.message;
|
||||||
|
this.forceRender();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,16 @@ export type ClientMethod =
|
|||||||
| {
|
| {
|
||||||
method: "Users";
|
method: "Users";
|
||||||
users: Record<string, ClientMeta>;
|
users: Record<string, ClientMeta>;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
method: "MessageEdited";
|
||||||
|
channel_id: string;
|
||||||
|
message: StoredMessage;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
method: "MessageDeleted";
|
||||||
|
channel_id: string;
|
||||||
|
message_id: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ServerMethod =
|
export type ServerMethod =
|
||||||
@@ -49,4 +59,16 @@ export type ServerMethod =
|
|||||||
| {
|
| {
|
||||||
method: "GetUsers";
|
method: "GetUsers";
|
||||||
pubkeys: string[];
|
pubkeys: string[];
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
method: "EditMessage";
|
||||||
|
message_id: string;
|
||||||
|
channel_id: string;
|
||||||
|
content: string;
|
||||||
|
signature: string;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
method: "DeleteMessage";
|
||||||
|
channel_id: string;
|
||||||
|
message_id: string;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user