Skip to content

Commit

Permalink
Merge pull request #8 from Tandashi/fix/#6/RemoveDepricatedCode
Browse files Browse the repository at this point in the history
Remove old code that was kept to support older versions < 1.7.0
  • Loading branch information
DrRago authored Feb 1, 2021
2 parents e3a6322 + 8a71ad9 commit 9c683de
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 197 deletions.
Binary file removed public/img/badge/promote.png
Binary file not shown.
Binary file removed public/img/badge/unpromote.png
Binary file not shown.
Binary file removed public/img/role/promoted.png
Binary file not shown.
Binary file removed public/img/role/promoted_.png
Binary file not shown.
4 changes: 0 additions & 4 deletions src/model/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ export enum Role {
HOST = 'host',
SUB_HOST = 'sub-host',
MODERATOR = 'moderator',
/**
* @deprecated in favor of {@link SUB_HOST} & {@link MODERATOR} permissions.
*/
PROMOTED = 'promoted',
MEMBER = 'member'
}
10 changes: 0 additions & 10 deletions src/model/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ export class Room {
return this.getClient(socket).role === Role.MODERATOR;
}

/**
* Check if the given socket is PROMOTED.
*
* @deprecated in favor of {@link SUB_HOST} & {@link MODERATOR} permissions.
* @param socket The socket to check
*/
public isPromoted(socket: SocketIO.Socket): boolean {
return this.getClient(socket).role === Role.PROMOTED;
}

/**
* Update the rooms video state.
*
Expand Down
10 changes: 1 addition & 9 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ io.of(/.*/).on('connection', (socket: SocketIO.Socket) => {
const isHost = room.isHost(socket);
const isSubHost = room.isSubHost(socket);
// check for PROMOTED role to stay backwards compatible as MODERATOR and PROMOTED have the same permissions
const isModerator = room.isModerator(socket) || room.isPromoted(socket);
const isModerator = room.isModerator(socket);

// Check roles of the sender
// MEMBER - may send reactions
Expand All @@ -60,14 +60,6 @@ io.of(/.*/).on('connection', (socket: SocketIO.Socket) => {
case Message.SET_ROLE_SUB_HOST:
room.changeRoleByClient(room.getClientBySocketId(cmdData), Role.SUB_HOST);
return;
// deprecated - backwards compatibility
case Message.PROMOTE:
room.changeRoleByClient(room.getClientBySocketId(cmdData), Role.PROMOTED);
return;
// deprecated - backwards compatibility
case Message.UNPROMOTE:
room.changeRoleByClient(room.getClientBySocketId(cmdData), Role.MEMBER);
return;
}
}

Expand Down
370 changes: 196 additions & 174 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 9c683de

Please sign in to comment.