Browse Source

style(WS): socket listener names should be standardised

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
b2d8d85176

+ 2 - 2
backend/logic/actions/activities.js

@@ -29,12 +29,12 @@ CacheModule.runJob("SUB", {
 		const { activityId, userId } = res;
 
 		WSModule.runJob("SOCKETS_FROM_USER", { userId }, this).then(sockets =>
-			sockets.forEach(socket => socket.dispatch("event:activity.hide", { data: { activityId } }))
+			sockets.forEach(socket => socket.dispatch("event:activity.hidden", { data: { activityId } }))
 		);
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `profile-${userId}-activities`,
-			args: ["event:activity.hide", { data: { activityId } }]
+			args: ["event:activity.hidden", { data: { activityId } }]
 		});
 	}
 });

+ 2 - 2
backend/logic/actions/news.js

@@ -30,12 +30,12 @@ CacheModule.runJob("SUB", {
 	cb: newsId => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: "admin.news",
-			args: ["event:admin.news.removed", { data: { newsId } }]
+			args: ["event:admin.news.deleted", { data: { newsId } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: "news",
-			args: ["event:news.removed", { data: { newsId } }]
+			args: ["event:news.deleted", { data: { newsId } }]
 		});
 	}
 });

+ 14 - 14
backend/logic/actions/playlists.js

@@ -18,13 +18,13 @@ CacheModule.runJob("SUB", {
 	channel: "playlist.create",
 	cb: playlist => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: playlist.createdBy }, this).then(sockets =>
-			sockets.forEach(socket => socket.dispatch("event:playlist.create", { data: { playlist } }))
+			sockets.forEach(socket => socket.dispatch("d", { data: { playlist } }))
 		);
 
 		if (playlist.privacy === "public")
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `profile-${playlist.createdBy}-playlists`,
-				args: ["event:playlist.create", { data: { playlist } }]
+				args: ["event:playlist.created", { data: { playlist } }]
 			});
 	}
 });
@@ -34,13 +34,13 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:playlist.delete", { data: { playlistId: res.playlistId } });
+				socket.dispatch("event:playlist.deleted", { data: { playlistId: res.playlistId } });
 			});
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `profile-${res.userId}-playlists`,
-			args: ["event:playlist.delete", { data: { playlistId: res.playlistId } }]
+			args: ["event:playlist.deleted", { data: { playlistId: res.playlistId } }]
 		});
 	}
 });
@@ -50,7 +50,7 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets =>
 			sockets.forEach(socket =>
-				socket.dispatch("event:playlist.repositionSongs", {
+				socket.dispatch("event:playlist.songs.repositioned", {
 					data: {
 						playlistId: res.playlistId,
 						songsBeingChanged: res.songsBeingChanged
@@ -66,7 +66,7 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:playlist.addSong", {
+				socket.dispatch("event:playlist.song.added", {
 					data: {
 						playlistId: res.playlistId,
 						song: res.song
@@ -79,7 +79,7 @@ CacheModule.runJob("SUB", {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `profile-${res.userId}-playlists`,
 				args: [
-					"event:playlist.addSong",
+					"event:playlist.song.added",
 					{
 						data: {
 							playlistId: res.playlistId,
@@ -96,7 +96,7 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:playlist.removeSong", {
+				socket.dispatch("event:playlist.song.removed", {
 					data: {
 						playlistId: res.playlistId,
 						youtubeId: res.youtubeId
@@ -109,7 +109,7 @@ CacheModule.runJob("SUB", {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `profile-${res.userId}-playlists`,
 				args: [
-					"event:playlist.removeSong",
+					"event:playlist.song.removed",
 					{
 						data: {
 							playlistId: res.playlistId,
@@ -126,7 +126,7 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:playlist.updateDisplayName", {
+				socket.dispatch("event:playlist.displayName.updated", {
 					data: {
 						playlistId: res.playlistId,
 						displayName: res.displayName
@@ -139,7 +139,7 @@ CacheModule.runJob("SUB", {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `profile-${res.userId}-playlists`,
 				args: [
-					"event:playlist.updateDisplayName",
+					"event:playlist.displayName.updated",
 					{
 						data: {
 							playlistId: res.playlistId,
@@ -156,7 +156,7 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:playlist.updatePrivacy", {
+				socket.dispatch("event:playlist.privacy.updated", {
 					data: {
 						playlist: res.playlist
 					}
@@ -168,7 +168,7 @@ CacheModule.runJob("SUB", {
 			return WSModule.runJob("EMIT_TO_ROOM", {
 				room: `profile-${res.userId}-playlists`,
 				args: [
-					"event:playlist.create",
+					"event:playlist.created",
 					{
 						data: {
 							playlist: res.playlist
@@ -180,7 +180,7 @@ CacheModule.runJob("SUB", {
 		return WSModule.runJob("EMIT_TO_ROOM", {
 			room: `profile-${res.userId}-playlists`,
 			args: [
-				"event:playlist.delete",
+				"event:playlist.deleted",
 				{
 					data: {
 						playlistId: res.playlist._id

+ 1 - 1
backend/logic/actions/punishments.js

@@ -15,7 +15,7 @@ CacheModule.runJob("SUB", {
 	cb: data => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: "admin.punishments",
-			args: ["event:admin.punishment.added", { data: { punishment: data.punishment } }]
+			args: ["event:admin.punishment.created", { data: { punishment: data.punishment } }]
 		});
 
 		WSModule.runJob("SOCKETS_FROM_IP", { ip: data.ip }, this).then(sockets => {

+ 20 - 17
backend/logic/actions/songs.js

@@ -23,12 +23,12 @@ CacheModule.runJob("SUB", {
 		songModel.findOne({ _id: songId }, (err, song) => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: "admin.unverifiedSongs",
-				args: ["event:admin.unverifiedSong.added", { data: { song } }]
+				args: ["event:admin.unverifiedSong.created", { data: { song } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `edit-song.${songId}`,
-				args: ["event:admin.unverifiedSong.added", { data: { song } }]
+				args: ["event:admin.unverifiedSong.created", { data: { song } }]
 			});
 		});
 	}
@@ -39,7 +39,7 @@ CacheModule.runJob("SUB", {
 	cb: songId => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: "admin.unverifiedSongs",
-			args: ["event:admin.unverifiedSong.removed", { data: { songId } }]
+			args: ["event:admin.unverifiedSong.deleted", { data: { songId } }]
 		});
 	}
 });
@@ -67,12 +67,12 @@ CacheModule.runJob("SUB", {
 		songModel.findOne({ _id: songId }, (err, song) => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: "admin.songs",
-				args: ["event:admin.verifiedSong.added", { data: { song } }]
+				args: ["event:admin.verifiedSong.created", { data: { song } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `edit-song.${songId}`,
-				args: ["event:admin.verifiedSong.added", { data: { song } }]
+				args: ["event:admin.verifiedSong.created", { data: { song } }]
 			});
 		});
 	}
@@ -83,7 +83,7 @@ CacheModule.runJob("SUB", {
 	cb: songId => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: "admin.songs",
-			args: ["event:admin.verifiedSong.removed", { data: { songId } }]
+			args: ["event:admin.verifiedSong.deleted", { data: { songId } }]
 		});
 	}
 });
@@ -110,12 +110,12 @@ CacheModule.runJob("SUB", {
 		songModel.findOne({ _id: songId }, (err, song) => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: "admin.hiddenSongs",
-				args: ["event:admin.hiddenSong.added", { data: { song } }]
+				args: ["event:admin.hiddenSong.created", { data: { song } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `edit-song.${songId}`,
-				args: ["event:admin.hiddenSong.added", { data: { song } }]
+				args: ["event:admin.hiddenSong.created", { data: { song } }]
 			});
 		});
 	}
@@ -126,7 +126,7 @@ CacheModule.runJob("SUB", {
 	cb: songId => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: "admin.hiddenSongs",
-			args: ["event:admin.hiddenSong.removed", { data: { songId } }]
+			args: ["event:admin.hiddenSong.deleted", { data: { songId } }]
 		});
 	}
 });
@@ -153,7 +153,7 @@ CacheModule.runJob("SUB", {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `song.${data.youtubeId}`,
 			args: [
-				"event:song.like",
+				"event:song.liked",
 				{
 					data: { youtubeId: data.youtubeId, likes: data.likes, dislikes: data.dislikes }
 				}
@@ -162,7 +162,7 @@ CacheModule.runJob("SUB", {
 
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:song.newRatings", {
+				socket.dispatch("event:song.ratings.updated", {
 					data: {
 						youtubeId: data.youtubeId,
 						liked: true,
@@ -180,15 +180,16 @@ CacheModule.runJob("SUB", {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `song.${data.youtubeId}`,
 			args: [
-				"event:song.dislike",
+				"event:song.disliked",
 				{
 					data: { youtubeId: data.youtubeId, likes: data.likes, dislikes: data.dislikes }
 				}
 			]
 		});
+
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:song.newRatings", {
+				socket.dispatch("event:song.ratings.updated", {
 					data: {
 						youtubeId: data.youtubeId,
 						liked: false,
@@ -206,15 +207,16 @@ CacheModule.runJob("SUB", {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `song.${data.youtubeId}`,
 			args: [
-				"event:song.unlike",
+				"event:song.unliked",
 				{
 					data: { youtubeId: data.youtubeId, likes: data.likes, dislikes: data.dislikes }
 				}
 			]
 		});
+
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:song.newRatings", {
+				socket.dispatch("event:song.ratings.updated", {
 					data: {
 						youtubeId: data.youtubeId,
 						liked: false,
@@ -232,15 +234,16 @@ CacheModule.runJob("SUB", {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `song.${data.youtubeId}`,
 			args: [
-				"event:song.undislike",
+				"event:song.undisliked",
 				{
 					data: { youtubeId: data.youtubeId, likes: data.likes, dislikes: data.dislikes }
 				}
 			]
 		});
+
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:song.newRatings", {
+				socket.dispatch("event:song.ratings.updated", {
 					data: {
 						youtubeId: data.youtubeId,
 						liked: false,

+ 50 - 46
backend/logic/actions/stations.js

@@ -20,7 +20,7 @@ CacheModule.runJob("SUB", {
 	cb: ({ stationId, usersPerStation }) => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:users.updated", { data: { users: usersPerStation } }]
+			args: ["event:station.users.updated", { data: { users: usersPerStation } }]
 		});
 	}
 });
@@ -32,14 +32,14 @@ CacheModule.runJob("SUB", {
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:userCount.updated", { data: { userCount: count } }]
+			args: ["event:station.userCount.updated", { data: { userCount: count } }]
 		});
 
 		StationsModule.runJob("GET_STATION", { stationId }).then(async station => {
 			if (station.privacy === "public")
 				WSModule.runJob("EMIT_TO_ROOM", {
 					room: "home",
-					args: ["event:userCount.updated", { data: { stationId, userCount: count } }]
+					args: ["event:station.userCount.updated", { data: { stationId, userCount: count } }]
 				});
 			else {
 				const sockets = await WSModule.runJob("GET_SOCKETS_FOR_ROOM", {
@@ -65,9 +65,13 @@ CacheModule.runJob("SUB", {
 								).then(userModel =>
 									userModel.findOne({ _id: session.userId }, (err, user) => {
 										if (user.role === "admin")
-											socket.dispatch("event:userCount.updated", { data: { stationId, count } });
+											socket.dispatch("event:station.userCount.updated", {
+												data: { stationId, count }
+											});
 										else if (station.type === "community" && station.owner === session.userId)
-											socket.dispatch("event:userCount.updated", { data: { stationId, count } });
+											socket.dispatch("event:station.userCount.updated", {
+												data: { stationId, count }
+											});
 									})
 								);
 						});
@@ -84,12 +88,12 @@ CacheModule.runJob("SUB", {
 		const { stationId, locked } = data;
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:queueLockToggled", { data: { locked } }]
+			args: ["event:station.queue.lock.toggled", { data: { locked } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `manage-station.${stationId}`,
-			args: ["event:queueLockToggled", { data: { stationId, locked } }]
+			args: ["event:station.queue.lock.toggled", { data: { stationId, locked } }]
 		});
 	}
 });
@@ -101,12 +105,12 @@ CacheModule.runJob("SUB", {
 		StationsModule.runJob("GET_STATION", { stationId }).then(station => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `station.${stationId}`,
-				args: ["event:partyMode.updated", { data: { partyMode } }]
+				args: ["event:station.partyMode.updated", { data: { partyMode } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `manage-station.${stationId}`,
-				args: ["event:partyMode.updated", { data: { stationId, partyMode } }]
+				args: ["event:station.partyMode.updated", { data: { stationId, partyMode } }]
 			});
 
 			StationsModule.runJob("GET_SOCKETS_THAT_CAN_KNOW_ABOUT_STATION", {
@@ -115,7 +119,7 @@ CacheModule.runJob("SUB", {
 			}).then(response => {
 				const { socketsThatCan } = response;
 				socketsThatCan.forEach(socket => {
-					socket.dispatch("event:station.updatePartyMode", { data: { stationId, partyMode } });
+					socket.dispatch("event:station.partyMode.updated", { data: { stationId, partyMode } });
 				});
 			});
 		});
@@ -129,12 +133,12 @@ CacheModule.runJob("SUB", {
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:playMode.updated", { data: { playMode } }]
+			args: ["event:station.playMode.updated", { data: { playMode } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `manage-station.${stationId}`,
-			args: ["event:playMode.updated", { data: { stationId, playMode } }]
+			args: ["event:station.playMode.updated", { data: { stationId, playMode } }]
 		});
 	}
 });
@@ -235,12 +239,12 @@ CacheModule.runJob("SUB", {
 		StationsModule.runJob("GET_STATION", { stationId }).then(station => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `station.${stationId}`,
-				args: ["event:stations.pause", { data: { pausedAt: station.pausedAt } }]
+				args: ["event:station.pause", { data: { pausedAt: station.pausedAt } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `manage-station.${stationId}`,
-				args: ["event:stations.pause", { data: { stationId, pausedAt: station.pausedAt } }]
+				args: ["event:station.pause", { data: { stationId, pausedAt: station.pausedAt } }]
 			});
 
 			StationsModule.runJob("GET_SOCKETS_THAT_CAN_KNOW_ABOUT_STATION", {
@@ -262,12 +266,12 @@ CacheModule.runJob("SUB", {
 		StationsModule.runJob("GET_STATION", { stationId }).then(station => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `station.${stationId}`,
-				args: ["event:stations.resume", { data: { timePaused: station.timePaused } }]
+				args: ["event:station.resume", { data: { timePaused: station.timePaused } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `manage-station.${stationId}`,
-				args: ["event:stations.resume", { data: { stationId, timePaused: station.timePaused } }]
+				args: ["event:station.resume", { data: { stationId, timePaused: station.timePaused } }]
 			});
 
 			StationsModule.runJob("GET_SOCKETS_THAT_CAN_KNOW_ABOUT_STATION", {
@@ -296,7 +300,7 @@ CacheModule.runJob("SUB", {
 
 					WSModule.runJob("EMIT_TO_ROOM", {
 						room: "home",
-						args: ["event:stations.created", { data: { station } }]
+						args: ["event:station.created", { data: { station } }]
 					});
 				} else if (previousPrivacy === "public") {
 					// Station became hidden
@@ -307,12 +311,12 @@ CacheModule.runJob("SUB", {
 					}).then(response => {
 						const { socketsThatCan, socketsThatCannot } = response;
 						socketsThatCan.forEach(socket => {
-							socket.dispatch("event:station.updatePrivacy", {
+							socket.dispatch("event:station.privacy.updated", {
 								data: { stationId, privacy: station.privacy }
 							});
 						});
 						socketsThatCannot.forEach(socket => {
-							socket.dispatch("event:station.removed", { data: { stationId } });
+							socket.dispatch("event:station.deleted", { data: { stationId } });
 						});
 					});
 				} else {
@@ -324,7 +328,7 @@ CacheModule.runJob("SUB", {
 					}).then(response => {
 						const { socketsThatCan } = response;
 						socketsThatCan.forEach(socket => {
-							socket.dispatch("event:station.updatePrivacy", {
+							socket.dispatch("event:station.privacy.updated", {
 								data: { stationId, privacy: station.privacy }
 							});
 						});
@@ -334,12 +338,12 @@ CacheModule.runJob("SUB", {
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `station.${stationId}`,
-				args: ["event:station.updatePrivacy", { data: { privacy: station.privacy } }]
+				args: ["event:station.privacy.updated", { data: { privacy: station.privacy } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `manage-station.${stationId}`,
-				args: ["event:station.updatePrivacy", { data: { stationId, privacy: station.privacy } }]
+				args: ["event:station.privacy.updated", { data: { stationId, privacy: station.privacy } }]
 			});
 		});
 	}
@@ -357,19 +361,19 @@ CacheModule.runJob("SUB", {
 			}).then(response => {
 				const { socketsThatCan } = response;
 				socketsThatCan.forEach(socket =>
-					socket.dispatch("event:station.updateName", { data: { stationId, name } })
+					socket.dispatch("event:station.name.updated", { data: { stationId, name } })
 				);
 			});
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:station.updateName", { data: { stationId, name } }]
+			args: ["event:station.name.updated", { data: { stationId, name } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `manage-station.${stationId}`,
-			args: ["event:station.updateName", { data: { stationId, name } }]
+			args: ["event:station.name.updated", { data: { stationId, name } }]
 		});
 	}
 });
@@ -386,19 +390,19 @@ CacheModule.runJob("SUB", {
 			}).then(response => {
 				const { socketsThatCan } = response;
 				socketsThatCan.forEach(socket =>
-					socket.dispatch("event:station.updateDisplayName", { data: { stationId, displayName } })
+					socket.dispatch("event:station.displayName.updated", { data: { stationId, displayName } })
 				);
 			})
 		);
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:station.updateDisplayName", { data: { stationId, displayName } }]
+			args: ["event:station.displayName.updated", { data: { stationId, displayName } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `manage-station.${stationId}`,
-			args: ["event:station.updateDisplayName", { data: { stationId, displayName } }]
+			args: ["event:station.displayName.updated", { data: { stationId, displayName } }]
 		});
 	}
 });
@@ -415,19 +419,19 @@ CacheModule.runJob("SUB", {
 			}).then(response => {
 				const { socketsThatCan } = response;
 				socketsThatCan.forEach(socket =>
-					socket.dispatch("event:station.updateDescription", { data: { stationId, description } })
+					socket.dispatch("event:station.description.updated", { data: { stationId, description } })
 				);
 			})
 		);
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:station.updateDescription", { data: { stationId, description } }]
+			args: ["event:station.description.updated", { data: { stationId, description } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `manage-station.${stationId}`,
-			args: ["event:station.updateDescription", { data: { stationId, description } }]
+			args: ["event:station.description.updated", { data: { stationId, description } }]
 		});
 	}
 });
@@ -440,12 +444,12 @@ CacheModule.runJob("SUB", {
 		StationsModule.runJob("GET_STATION", { stationId }).then(station => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `station.${stationId}`,
-				args: ["event:station.themeUpdated", { data: { theme: station.theme } }]
+				args: ["event:station.theme.updated", { data: { theme: station.theme } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `manage-station.${stationId}`,
-				args: ["event:station.themeUpdated", { data: { stationId, theme: station.theme } }]
+				args: ["event:station.theme.updated", { data: { stationId, theme: station.theme } }]
 			});
 
 			StationsModule.runJob("GET_SOCKETS_THAT_CAN_KNOW_ABOUT_STATION", {
@@ -454,7 +458,7 @@ CacheModule.runJob("SUB", {
 			}).then(res => {
 				const { socketsThatCan } = res;
 				socketsThatCan.forEach(socket => {
-					socket.dispatch("event:station.updateTheme", { data: { stationId, theme: station.theme } });
+					socket.dispatch("event:station.theme.updated", { data: { stationId, theme: station.theme } });
 				});
 			});
 		});
@@ -467,12 +471,12 @@ CacheModule.runJob("SUB", {
 		StationsModule.runJob("GET_STATION", { stationId }).then(station => {
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `station.${stationId}`,
-				args: ["event:queue.update", { data: { queue: station.queue } }]
+				args: ["event:station.queue.updated", { data: { queue: station.queue } }]
 			});
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: `manage-station.${stationId}`,
-				args: ["event:queue.update", { data: { stationId, queue: station.queue } }]
+				args: ["event:station.queue.updated", { data: { stationId, queue: station.queue } }]
 			});
 		});
 	}
@@ -483,12 +487,12 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${res.stationId}`,
-			args: ["event:queue.repositionSong", { data: { song: res.song } }]
+			args: ["event:station.queue.song.repositioned", { data: { song: res.song } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `manage-station.${res.stationId}`,
-			args: ["event:queue.repositionSong", { data: { song: res.song } }]
+			args: ["event:station.queue.song.repositioned", { data: { song: res.song } }]
 		});
 	}
 });
@@ -498,7 +502,7 @@ CacheModule.runJob("SUB", {
 	cb: stationId => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:song.voteSkipSong"]
+			args: ["event:station.voteSkipSong"]
 		});
 	}
 });
@@ -508,17 +512,17 @@ CacheModule.runJob("SUB", {
 	cb: stationId => {
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `station.${stationId}`,
-			args: ["event:stations.remove"]
+			args: ["event:station.deleted"]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `home`,
-			args: ["event:station.removed", { data: { stationId } }]
+			args: ["event:station.deleted", { data: { stationId } }]
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: "admin.stations",
-			args: ["event:admin.station.removed", { data: { stationId } }]
+			args: ["event:admin.station.deleted", { data: { stationId } }]
 		});
 	}
 });
@@ -534,14 +538,14 @@ CacheModule.runJob("SUB", {
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: "admin.stations",
-				args: ["event:admin.station.added", { data: { station } }]
+				args: ["event:admin.station.created", { data: { station } }]
 			}).then(() => {});
 
 			// TODO If community, check if on whitelist
 			if (station.privacy === "public")
 				WSModule.runJob("EMIT_TO_ROOM", {
 					room: "home",
-					args: ["event:stations.created", { data: { station } }]
+					args: ["event:station.created", { data: { station } }]
 				}).then(() => {});
 			else {
 				const sockets = await WSModule.runJob("GET_SOCKETS_FOR_ROOM", {
@@ -560,9 +564,9 @@ CacheModule.runJob("SUB", {
 							if (session) {
 								userModel.findOne({ _id: session.userId }, (err, user) => {
 									if (user.role === "admin")
-										socket.dispatch("event:stations.created", { data: { station } });
+										socket.dispatch("event:station.created", { data: { station } });
 									else if (station.type === "community" && station.owner === session.userId)
-										socket.dispatch("event:stations.created", { data: { station } });
+										socket.dispatch("event:station.created", { data: { station } });
 								});
 							}
 						});

+ 13 - 13
backend/logic/actions/users.js

@@ -24,7 +24,7 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("keep.event:user.preferences.changed", { data: { preferences: res.preferences } });
+				socket.dispatch("keep.event:user.preferences.updated", { data: { preferences: res.preferences } });
 			});
 		});
 	}
@@ -35,7 +35,7 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.orderOfFavoriteStations.changed", {
+				socket.dispatch("event:user.orderOfFavoriteStations.updated", {
 					data: { order: res.favoriteStations }
 				});
 			});
@@ -48,13 +48,13 @@ CacheModule.runJob("SUB", {
 	cb: res => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: res.userId }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.orderOfPlaylists.changed", { data: { order: res.orderOfPlaylists } });
+				socket.dispatch("event:user.orderOfPlaylists.updated", { data: { order: res.orderOfPlaylists } });
 			});
 		});
 
 		WSModule.runJob("EMIT_TO_ROOM", {
 			room: `profile-${res.userId}-playlists`,
-			args: ["event:user.orderOfPlaylists.changed", { data: { order: res.orderOfPlaylists } }]
+			args: ["event:user.orderOfPlaylists.updated", { data: { order: res.orderOfPlaylists } }]
 		});
 	}
 });
@@ -64,7 +64,7 @@ CacheModule.runJob("SUB", {
 	cb: user => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: user._id }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.username.changed", { data: { username: user.username } });
+				socket.dispatch("event:user.username.updated", { data: { username: user.username } });
 			});
 		});
 	}
@@ -74,7 +74,7 @@ CacheModule.runJob("SUB", {
 	channel: "user.removeSessions",
 	cb: userId => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId }).then(sockets =>
-			sockets.forEach(socket => socket.dispatch("keep.event:user.session.removed"))
+			sockets.forEach(socket => socket.dispatch("keep.event:user.session.deleted"))
 		);
 	}
 });
@@ -84,7 +84,7 @@ CacheModule.runJob("SUB", {
 	cb: userId => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.linkPassword");
+				socket.dispatch("event:user.password.linked");
 			});
 		});
 	}
@@ -95,7 +95,7 @@ CacheModule.runJob("SUB", {
 	cb: userId => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.unlinkPassword");
+				socket.dispatch("event:user.password.unlinked");
 			});
 		});
 	}
@@ -106,7 +106,7 @@ CacheModule.runJob("SUB", {
 	cb: userId => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.linkGithub");
+				socket.dispatch("event:user.github.linked");
 			});
 		});
 	}
@@ -117,7 +117,7 @@ CacheModule.runJob("SUB", {
 	cb: userId => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.unlinkGithub");
+				socket.dispatch("event:user.github.unlinked");
 			});
 		});
 	}
@@ -128,7 +128,7 @@ CacheModule.runJob("SUB", {
 	cb: data => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("keep.event:banned", { data: { ban: data.punishment } });
+				socket.dispatch("keep.event:user.banned", { data: { ban: data.punishment } });
 				socket.disconnect(true);
 			});
 		});
@@ -140,7 +140,7 @@ CacheModule.runJob("SUB", {
 	cb: data => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.favoritedStation", { data: { stationId: data.stationId } });
+				socket.dispatch("event:user.station.favorited", { data: { stationId: data.stationId } });
 			});
 		});
 	}
@@ -151,7 +151,7 @@ CacheModule.runJob("SUB", {
 	cb: data => {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
-				socket.dispatch("event:user.unfavoritedStation", { data: { stationId: data.stationId } });
+				socket.dispatch("event:user.station.unfavorited", { data: { stationId: data.stationId } });
 			});
 		});
 	}

+ 8 - 8
backend/logic/activities.js

@@ -75,7 +75,7 @@ class _ActivitiesModule extends CoreClass {
 						WSModule.runJob("SOCKETS_FROM_USER", { userId: activity.userId }, this)
 							.then(sockets => {
 								sockets.forEach(socket =>
-									socket.dispatch("event:activity.create", { data: { activity } })
+									socket.dispatch("event:activity.created", { data: { activity } })
 								);
 								next(null, activity);
 							})
@@ -85,7 +85,7 @@ class _ActivitiesModule extends CoreClass {
 					(activity, next) => {
 						WSModule.runJob("EMIT_TO_ROOM", {
 							room: `profile-${activity.userId}-activities`,
-							args: ["event:activity.create", { data: { activity } }]
+							args: ["event:activity.created", { data: { activity } }]
 						});
 
 						return next(null, activity);
@@ -231,14 +231,14 @@ class _ActivitiesModule extends CoreClass {
 							WSModule.runJob("SOCKETS_FROM_USER", { userId: payload.userId }, this)
 								.then(sockets =>
 									sockets.forEach(socket =>
-										socket.dispatch("event:activity.hide", { data: { activityId: activity._id } })
+										socket.dispatch("event:activity.hidden", { data: { activityId: activity._id } })
 									)
 								)
 								.catch(next);
 
 							WSModule.runJob("EMIT_TO_ROOM", {
 								room: `profile-${payload.userId}-activities`,
-								args: ["event:activity.hide", { data: { activityId: activity._id } }]
+								args: ["event:activity.hidden", { data: { activityId: activity._id } }]
 							});
 
 							if (activity.type === payload.type) howManySongs += 1;
@@ -375,7 +375,7 @@ class _ActivitiesModule extends CoreClass {
 										WSModule.runJob("SOCKETS_FROM_USER", { userId: activity.userId })
 											.then(sockets =>
 												sockets.forEach(socket =>
-													socket.dispatch("event:activity.update", {
+													socket.dispatch("event:activity.updated", {
 														data: {
 															activityId: activity._id,
 															message: activity.payload.message
@@ -388,7 +388,7 @@ class _ActivitiesModule extends CoreClass {
 										WSModule.runJob("EMIT_TO_ROOM", {
 											room: `profile-${activity.userId}-activities`,
 											args: [
-												"event:activity.update",
+												"event:activity.updated",
 												{
 													data: {
 														activityId: activity._id,
@@ -459,14 +459,14 @@ class _ActivitiesModule extends CoreClass {
 							WSModule.runJob("SOCKETS_FROM_USER", { userId: payload.userId }, this)
 								.then(sockets =>
 									sockets.forEach(socket =>
-										socket.dispatch("event:activity.hide", { data: { activityId: activity._id } })
+										socket.dispatch("event:activity.hidden", { data: { activityId: activity._id } })
 									)
 								)
 								.catch(next);
 
 							WSModule.runJob("EMIT_TO_ROOM", {
 								room: `profile-${payload.userId}-activities`,
-								args: ["event:activity.hide", { data: { activityId: activity._id } }]
+								args: ["event:activity.hidden", { data: { activityId: activity._id } }]
 							});
 						});
 

+ 1 - 1
backend/logic/stations.js

@@ -951,7 +951,7 @@ class _StationsModule extends CoreClass {
 						WSModule.runJob("EMIT_TO_ROOM", {
 							room: `station.${station._id}`,
 							args: [
-								"event:songs.next",
+								"event:station.nextSong",
 								{
 									data: {
 										currentSong: station.currentSong,

+ 1 - 1
frontend/src/App.vue

@@ -152,7 +152,7 @@ export default {
 			}
 		});
 
-		this.socket.on("keep.event:user.session.removed", () =>
+		this.socket.on("keep.event:user.session.deleted", () =>
 			window.location.reload()
 		);
 	},

+ 3 - 3
frontend/src/components/AddToPlaylistDropdown.vue

@@ -77,11 +77,11 @@ export default {
 			}
 		});
 
-		this.socket.on("event:playlist.create", res => {
+		this.socket.on("event:playlist.created", res => {
 			this.playlists.push(res.data.playlist);
 		});
 
-		this.socket.on("event:playlist.delete", res => {
+		this.socket.on("event:playlist.deleted", res => {
 			this.playlists.forEach((playlist, index) => {
 				if (playlist._id === res.data.playlistId) {
 					this.playlists.splice(index, 1);
@@ -89,7 +89,7 @@ export default {
 			});
 		});
 
-		this.socket.on("event:playlist.updateDisplayName", res => {
+		this.socket.on("event:playlist.displayName.updated", res => {
 			this.playlists.forEach((playlist, index) => {
 				if (playlist._id === res.data.playlistId) {
 					this.playlists[index].displayName = res.data.displayName;

+ 4 - 4
frontend/src/components/modals/EditPlaylist.vue

@@ -452,7 +452,7 @@ export default {
 		});
 
 		this.socket.on(
-			"event:playlist.addSong",
+			"event:playlist.song.added",
 			res => {
 				if (this.playlist._id === res.data.playlistId)
 					this.playlist.songs.push(res.data.song);
@@ -463,7 +463,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:playlist.removeSong",
+			"event:playlist.song.removed",
 			res => {
 				if (this.playlist._id === res.data.playlistId) {
 					// remove song from array of playlists
@@ -488,7 +488,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:playlist.updateDisplayName",
+			"event:playlist.displayName.updated",
 			res => {
 				if (this.playlist._id === res.data.playlistId)
 					this.playlist.displayName = res.data.displayName;
@@ -499,7 +499,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:playlist.repositionSongs",
+			"event:playlist.songs.repositioned",
 			res => {
 				if (this.playlist._id === res.data.playlistId) {
 					// for each song that has a new position

+ 6 - 6
frontend/src/components/modals/EditSong.vue

@@ -856,29 +856,29 @@ export default {
 		localStorage.setItem("volume", volume);
 		this.volumeSliderValue = volume * 100;
 
-		this.socket.on("event:admin.hiddenSong.added", res => {
+		this.socket.on("event:admin.hiddenSong.created", res => {
 			this.song.status = res.data.song.status;
 		});
 
-		this.socket.on("event:admin.unverifiedSong.added", res => {
+		this.socket.on("event:admin.unverifiedSong.created", res => {
 			this.song.status = res.data.song.status;
 		});
 
-		this.socket.on("event:admin.verifiedSong.added", res => {
+		this.socket.on("event:admin.verifiedSong.created", res => {
 			this.song.status = res.data.song.status;
 		});
 
-		this.socket.on("event:admin.hiddenSong.removed", () => {
+		this.socket.on("event:admin.hiddenSong.deleted", () => {
 			new Toast("The song you were editing was removed");
 			this.closeModal("editSong");
 		});
 
-		this.socket.on("event:admin.unverifiedSong.removed", () => {
+		this.socket.on("event:admin.unverifiedSong.deleted", () => {
 			new Toast("The song you were editing was removed");
 			this.closeModal("editSong");
 		});
 
-		this.socket.on("event:admin.verifiedSong.removed", () => {
+		this.socket.on("event:admin.verifiedSong.deleted", () => {
 			new Toast("The song you were editing was removed");
 			this.closeModal("editSong");
 		});

+ 13 - 13
frontend/src/components/modals/ManageStation/index.vue

@@ -289,7 +289,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:station.updateName",
+					"event:station.name.updated",
 					res => {
 						this.station.name = res.data.name;
 					},
@@ -297,7 +297,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:station.updateDisplayName",
+					"event:station.displayName.updated",
 					res => {
 						this.station.displayName = res.data.displayName;
 					},
@@ -305,7 +305,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:station.updateDescription",
+					"event:station.description.updated",
 					res => {
 						this.station.description = res.data.description;
 					},
@@ -313,7 +313,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:partyMode.updated",
+					"event:station.partyMode.updated",
 					res => {
 						if (this.station.type === "community")
 							this.station.partyMode = res.data.partyMode;
@@ -322,7 +322,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:playMode.updated",
+					"event:station.playMode.updated",
 					res => {
 						this.station.playMode = res.data.playMode;
 					},
@@ -330,7 +330,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:station.themeUpdated",
+					"event:station.theme.updated",
 					res => {
 						const { theme } = res.data;
 						this.station.theme = theme;
@@ -339,7 +339,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:station.updatePrivacy",
+					"event:station.privacy.updated",
 					res => {
 						this.station.privacy = res.data.privacy;
 					},
@@ -347,7 +347,7 @@ export default {
 				);
 
 				this.socket.on(
-					"event:queueLockToggled",
+					"event:station.queue.lock.toggled",
 					res => {
 						this.station.locked = res.data.locked;
 					},
@@ -412,31 +412,31 @@ export default {
 		});
 
 		this.socket.on(
-			"event:queue.update",
+			"event:station.queue.updated",
 			res => this.updateSongsList(res.data.queue),
 			{ modal: "manageStation" }
 		);
 
 		this.socket.on(
-			"event:queue.repositionSong",
+			"event:station.queue.song.repositioned",
 			res => this.repositionSongInList(res.data.song),
 			{ modal: "manageStation" }
 		);
 
 		this.socket.on(
-			"event:stations.pause",
+			"event:station.pause",
 			() => this.updateStationPaused(true),
 			{ modal: "manageStation" }
 		);
 
 		this.socket.on(
-			"event:stations.resume",
+			"event:station.resume",
 			() => this.updateStationPaused(false),
 			{ modal: "manageStation" }
 		);
 
 		this.socket.on(
-			"event:songs.next",
+			"event:station.nextSong",
 			res => {
 				const { currentSong } = res.data;
 

+ 3 - 3
frontend/src/main.js

@@ -195,15 +195,15 @@ lofig.folder = "../config/default.json";
 		});
 	});
 
-	ws.socket.on("keep.event:banned", res =>
+	ws.socket.on("keep.event:user.banned", res =>
 		store.dispatch("user/auth/banUser", res.data.ban)
 	);
 
-	ws.socket.on("event:user.username.changed", res =>
+	ws.socket.on("event:user.username.updated", res =>
 		store.dispatch("user/auth/updateUsername", res.data.username)
 	);
 
-	ws.socket.on("keep.event:user.preferences.changed", res => {
+	ws.socket.on("keep.event:user.preferences.updated", res => {
 		const { preferences } = res.data;
 
 		store.dispatch(

+ 7 - 7
frontend/src/mixins/SortablePlaylists.vue

@@ -35,13 +35,13 @@ export default {
 	},
 	mounted() {
 		this.socket.on(
-			"event:playlist.create",
+			"event:playlist.created",
 			res => this.playlists.push(res.data.playlist),
 			{ replaceable: true }
 		);
 
 		this.socket.on(
-			"event:playlist.delete",
+			"event:playlist.deleted",
 			res => {
 				this.playlists.forEach((playlist, index) => {
 					if (playlist._id === res.data.playlistId) {
@@ -53,7 +53,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:playlist.addSong",
+			"event:playlist.song.added",
 			res => {
 				this.playlists.forEach((playlist, index) => {
 					if (playlist._id === res.data.playlistId) {
@@ -65,7 +65,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:playlist.removeSong",
+			"event:playlist.song.removed",
 			res => {
 				this.playlists.forEach((playlist, index) => {
 					if (playlist._id === res.data.playlistId) {
@@ -81,7 +81,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:playlist.updateDisplayName",
+			"event:playlist.displayName.updated",
 			res => {
 				this.playlists.forEach((playlist, index) => {
 					if (playlist._id === res.data.playlistId) {
@@ -94,7 +94,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:playlist.updatePrivacy",
+			"event:playlist.privacy.updated",
 			res => {
 				this.playlists.forEach((playlist, index) => {
 					if (playlist._id === res.data.playlist._id) {
@@ -107,7 +107,7 @@ export default {
 		);
 
 		this.socket.on(
-			"event:user.orderOfPlaylists.changed",
+			"event:user.orderOfPlaylists.updated",
 			res => {
 				const sortedPlaylists = [];
 

+ 2 - 2
frontend/src/pages/Admin/tabs/HiddenSongs.vue

@@ -220,11 +220,11 @@ export default {
 		}
 	},
 	mounted() {
-		this.socket.on("event:admin.hiddenSong.added", res => {
+		this.socket.on("event:admin.hiddenSong.created", res => {
 			this.addSong(res.data.song);
 		});
 
-		this.socket.on("event:admin.hiddenSong.removed", res => {
+		this.socket.on("event:admin.hiddenSong.deleted", res => {
 			this.removeSong(res.data.songId);
 		});
 

+ 1 - 1
frontend/src/pages/Admin/tabs/News.vue

@@ -98,7 +98,7 @@ export default {
 			this.updateNews(res.data.news)
 		);
 
-		this.socket.on("event:admin.news.removed", res =>
+		this.socket.on("event:admin.news.deleted", res =>
 			this.removeNews(res.data.newsId)
 		);
 

+ 1 - 1
frontend/src/pages/Admin/tabs/Punishments.vue

@@ -128,7 +128,7 @@ export default {
 		if (this.socket.readyState === 1) this.init();
 		ws.onConnect(() => this.init());
 
-		this.socket.on("event:admin.punishment.added", res =>
+		this.socket.on("event:admin.punishment.created", res =>
 			this.punishments.push(res.data.punishment)
 		);
 	},

+ 2 - 2
frontend/src/pages/Admin/tabs/Stations.vue

@@ -234,11 +234,11 @@ export default {
 		if (this.socket.readyState === 1) this.init();
 		ws.onConnect(() => this.init());
 
-		this.socket.on("event:admin.station.added", res =>
+		this.socket.on("event:admin.station.created", res =>
 			this.stationAdded(res.data.station)
 		);
 
-		this.socket.on("event:admin.station.removed", res =>
+		this.socket.on("event:admin.station.deleted", res =>
 			this.stationRemoved(res.data.stationId)
 		);
 	},

+ 2 - 2
frontend/src/pages/Admin/tabs/UnverifiedSongs.vue

@@ -233,11 +233,11 @@ export default {
 		}
 	},
 	mounted() {
-		this.socket.on("event:admin.unverifiedSong.added", res => {
+		this.socket.on("event:admin.unverifiedSong.created", res => {
 			this.addSong(res.data.song);
 		});
 
-		this.socket.on("event:admin.unverifiedSong.removed", res => {
+		this.socket.on("event:admin.unverifiedSong.deleted", res => {
 			this.removeSong(res.data.songId);
 		});
 

+ 2 - 2
frontend/src/pages/Admin/tabs/VerifiedSongs.vue

@@ -326,11 +326,11 @@ export default {
 		}
 	},
 	mounted() {
-		this.socket.on("event:admin.verifiedSong.added", res =>
+		this.socket.on("event:admin.verifiedSong.created", res =>
 			this.addSong(res.data.song)
 		);
 
-		this.socket.on("event:admin.verifiedSong.removed", res =>
+		this.socket.on("event:admin.verifiedSong.deleted", res =>
 			this.removeSong(res.data.songId)
 		);
 

+ 12 - 12
frontend/src/pages/Home.vue

@@ -517,7 +517,7 @@ export default {
 		if (this.socket.readyState === 1) this.init();
 		ws.onConnect(() => this.init());
 
-		this.socket.on("event:stations.created", res => {
+		this.socket.on("event:station.created", res => {
 			const { station } = res.data;
 
 			if (this.stations.find(_station => _station._id === station._id)) {
@@ -538,7 +538,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:station.removed", res => {
+		this.socket.on("event:station.deleted", res => {
 			const { stationId } = res.data;
 
 			const station = this.stations.find(
@@ -556,7 +556,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:userCount.updated", res => {
+		this.socket.on("event:station.userCount.updated", res => {
 			const station = this.stations.find(
 				station => station._id === res.data.stationId
 			);
@@ -564,7 +564,7 @@ export default {
 			if (station) station.userCount = res.data.userCount;
 		});
 
-		this.socket.on("event:station.updatePrivacy", res => {
+		this.socket.on("event:station.privacy.updated", res => {
 			const station = this.stations.find(
 				station => station._id === res.data.stationId
 			);
@@ -572,7 +572,7 @@ export default {
 			if (station) station.privacy = res.data.privacy;
 		});
 
-		this.socket.on("event:station.updateName", res => {
+		this.socket.on("event:station.name.updated", res => {
 			const station = this.stations.find(
 				station => station._id === res.data.stationId
 			);
@@ -580,7 +580,7 @@ export default {
 			if (station) station.name = res.data.name;
 		});
 
-		this.socket.on("event:station.updateDisplayName", res => {
+		this.socket.on("event:station.displayName.updated", res => {
 			const station = this.stations.find(
 				station => station._id === res.data.stationId
 			);
@@ -588,7 +588,7 @@ export default {
 			if (station) station.displayName = res.data.displayName;
 		});
 
-		this.socket.on("event:station.updateDescription", res => {
+		this.socket.on("event:station.description.updated", res => {
 			const station = this.stations.find(
 				station => station._id === res.data.stationId
 			);
@@ -596,7 +596,7 @@ export default {
 			if (station) station.description = res.data.description;
 		});
 
-		this.socket.on("event:station.updateTheme", res => {
+		this.socket.on("event:station.theme.updated", res => {
 			const { stationId, theme } = res.data;
 			const station = this.stations.find(
 				station => station._id === stationId
@@ -605,7 +605,7 @@ export default {
 			if (station) station.theme = theme;
 		});
 
-		this.socket.on("event:station.updatePartyMode", res => {
+		this.socket.on("event:station.partyMode.updated", res => {
 			const { stationId, partyMode } = res.data;
 			const station = this.stations.find(
 				station => station._id === stationId
@@ -647,7 +647,7 @@ export default {
 			if (station) station.paused = false;
 		});
 
-		this.socket.on("event:user.favoritedStation", res => {
+		this.socket.on("event:user.station.favorited", res => {
 			const { stationId } = res.data;
 
 			const station = this.stations.find(
@@ -660,7 +660,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:user.unfavoritedStation", res => {
+		this.socket.on("event:user.station.unfavorited", res => {
 			const { stationId } = res.data;
 
 			const station = this.stations.find(
@@ -675,7 +675,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:user.orderOfFavoriteStations.changed", res => {
+		this.socket.on("event:user.orderOfFavoriteStations.updated", res => {
 			this.orderOfFavoriteStations = res.data.order;
 		});
 	},

+ 1 - 1
frontend/src/pages/News.vue

@@ -97,7 +97,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:news.removed", res => {
+		this.socket.on("event:news.deleted", res => {
 			this.news = this.news.filter(item => item._id !== res.data.newsId);
 		});
 

+ 2 - 2
frontend/src/pages/Profile/tabs/RecentActivity.vue

@@ -97,13 +97,13 @@ export default {
 			}
 		});
 
-		this.socket.on("event:activity.update", res => {
+		this.socket.on("event:activity.updated", res => {
 			this.activities.find(
 				activity => activity._id === res.data.activityId
 			).payload.message = res.data.message;
 		});
 
-		this.socket.on("event:activity.create", res => {
+		this.socket.on("event:activity.created", res => {
 			this.activities.unshift(res.data.activity);
 			this.offsettedFromNextSet += 1;
 		});

+ 1 - 1
frontend/src/pages/Settings/tabs/Preferences.vue

@@ -107,7 +107,7 @@ export default {
 			}
 		});
 
-		this.socket.on("keep.event:user.preferences.changed", res => {
+		this.socket.on("keep.event:user.preferences.updated", res => {
 			const { preferences } = res.data;
 
 			this.localNightmode = preferences.nightmode;

+ 22 - 22
frontend/src/pages/Station/index.vue

@@ -766,7 +766,7 @@ export default {
 			}
 		);
 
-		this.socket.on("event:songs.next", res => {
+		this.socket.on("event:station.nextSong", res => {
 			const {
 				currentSong,
 				startedAt,
@@ -792,7 +792,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:stations.pause", res => {
+		this.socket.on("event:station.pause", res => {
 			this.pausedAt = res.data.pausedAt;
 			this.updateStationPaused(true);
 			this.pauseLocalPlayer();
@@ -800,7 +800,7 @@ export default {
 			clearTimeout(window.stationNextSongTimeout);
 		});
 
-		this.socket.on("event:stations.resume", res => {
+		this.socket.on("event:station.resume", res => {
 			this.timePaused = res.data.timePaused;
 			this.updateStationPaused(false);
 			if (!this.localPaused) this.resumeLocalPlayer();
@@ -812,12 +812,12 @@ export default {
 				);
 		});
 
-		this.socket.on("event:stations.remove", () => {
+		this.socket.on("event:station.deleted", () => {
 			window.location.href = "/";
 			return true;
 		});
 
-		this.socket.on("event:song.like", res => {
+		this.socket.on("event:song.liked", res => {
 			if (!this.noSong) {
 				if (res.data.youtubeId === this.currentSong.youtubeId) {
 					this.currentSong.dislikes = res.data.dislikes;
@@ -826,7 +826,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:song.dislike", res => {
+		this.socket.on("event:song.disliked", res => {
 			if (!this.noSong) {
 				if (res.data.youtubeId === this.currentSong.youtubeId) {
 					this.currentSong.dislikes = res.data.dislikes;
@@ -835,7 +835,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:song.unlike", res => {
+		this.socket.on("event:song.unliked", res => {
 			if (!this.noSong) {
 				if (res.data.youtubeId === this.currentSong.youtubeId) {
 					this.currentSong.dislikes = res.data.dislikes;
@@ -844,7 +844,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:song.undislike", res => {
+		this.socket.on("event:song.undisliked", res => {
 			if (!this.noSong) {
 				if (res.data.youtubeId === this.currentSong.youtubeId) {
 					this.currentSong.dislikes = res.data.dislikes;
@@ -853,7 +853,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:song.newRatings", res => {
+		this.socket.on("event:song.ratings.updated", res => {
 			if (!this.noSong) {
 				if (res.data.youtubeId === this.currentSong.youtubeId) {
 					this.liked = res.data.liked;
@@ -862,7 +862,7 @@ export default {
 			}
 		});
 
-		this.socket.on("event:queue.update", res => {
+		this.socket.on("event:station.queue.updated", res => {
 			this.updateSongsList(res.data.queue);
 
 			let nextSong = null;
@@ -876,7 +876,7 @@ export default {
 			this.addPartyPlaylistSongToQueue();
 		});
 
-		this.socket.on("event:queue.repositionSong", res => {
+		this.socket.on("event:station.queue.song.repositioned", res => {
 			this.repositionSongInList(res.data.song);
 
 			let nextSong = null;
@@ -888,7 +888,7 @@ export default {
 			this.updateNextSong(nextSong);
 		});
 
-		this.socket.on("event:song.voteSkipSong", () => {
+		this.socket.on("event:station.voteSkipSong", () => {
 			if (this.currentSong) this.currentSong.skipVotes += 1;
 		});
 
@@ -902,18 +902,18 @@ export default {
 				this.station.privatePlaylist = null;
 		});
 
-		this.socket.on("event:partyMode.updated", res => {
+		this.socket.on("event:station.partyMode.updated", res => {
 			if (this.station.type === "community")
 				this.station.partyMode = res.data.partyMode;
 		});
 
-		this.socket.on("event:station.themeUpdated", res => {
+		this.socket.on("event:station.theme.updated", res => {
 			const { theme } = res.data;
 			this.station.theme = theme;
 			document.body.style.cssText = `--primary-color: var(--${theme})`;
 		});
 
-		this.socket.on("event:station.updateName", res => {
+		this.socket.on("event:station.name.updated", res => {
 			this.station.name = res.data.name;
 			// eslint-disable-next-line no-restricted-globals
 			history.pushState(
@@ -929,11 +929,11 @@ export default {
 			);
 		});
 
-		this.socket.on("event:station.updateDisplayName", res => {
+		this.socket.on("event:station.displayName.updated", res => {
 			this.station.displayName = res.data.displayName;
 		});
 
-		this.socket.on("event:station.updateDescription", res => {
+		this.socket.on("event:station.description.updated", res => {
 			this.station.description = res.data.description;
 		});
 
@@ -942,24 +942,24 @@ export default {
 		// 		this.updateSongsList(res.data.playlist);
 		// });
 
-		this.socket.on("event:users.updated", res =>
+		this.socket.on("event:station.users.updated", res =>
 			this.updateUsers(res.data.users)
 		);
 
-		this.socket.on("event:userCount.updated", res =>
+		this.socket.on("event:station.userCount.updated", res =>
 			this.updateUserCount(res.data.userCount)
 		);
 
-		this.socket.on("event:queueLockToggled", res => {
+		this.socket.on("event:station.queue.lock.toggled", res => {
 			this.station.locked = res.data.locked;
 		});
 
-		this.socket.on("event:user.favoritedStation", res => {
+		this.socket.on("event:user.station.favorited", res => {
 			if (res.data.stationId === this.station._id)
 				this.updateIfStationIsFavorited({ isFavorited: true });
 		});
 
-		this.socket.on("event:user.unfavoritedStation", res => {
+		this.socket.on("event:user.station.unfavorited", res => {
 			if (res.data.stationId === this.station._id)
 				this.updateIfStationIsFavorited({ isFavorited: false });
 		});