-
Notifications
You must be signed in to change notification settings - Fork 0
Delete message socket
Alvin Cheng edited this page Apr 23, 2023
·
2 revisions
This is the delete message socket, this socket will delete a message from the database with the 'server-message-delete' event. As well as telling all devices connected to the server so it could be updated at the same time. This socket will take an 'id' argument for the id for the message, a 'room' argument for the room of the operation, a 'responseToken' argument for the response and finally a 'key' argument for the key. Also as I mentioned before, we are NOT using the default websockets, we are using the socket.io library for web sockets.
A response token is a token to send a request to if an error occurs.
const io = require("socket.io");
const socket = io("<URL>", { transports: ["websocket"] });
// Send to server
socket.emit("server-message-delete", "<ID>", "<ROOM>", "<TOKEN>", "<KEY>");
socket.on("client-message-delete:room(<ROOM>)", () => {
/* This will run when a user in the same room types*/
});
- Home
- Login endpoint
- Block user endpoint
- Create room endpoint
- Delete user endpoint
- Get all rooms endpoint
- Get GIF endpoint
- Get messages endpoint
- Get public rooms endpoint
- Get user info endpoint
- Get users info endpoint (Deprecated)
- Join room endpoint
- Signup endpoint
- Report room endpoint
- Remove room endpoint
- Update description endpoint
- Follow user endpoint
- Unfollow user endpoint
- Update icon color endpoint
- Upload content endpoint
- Upload content endpoint (Deprecated)
- Verify client endpoint
- Upload token endpoint
- Chill&chat websockets
- Message socket
- Keyboard socket
- Delete message socket
- User content
- Final words&thoughts
- Run API