Skip to content

Commit

Permalink
Fix SC findings & Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
7PH committed Nov 26, 2023
1 parent b281e11 commit d1e7f15
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ When the source files change, the build processes re-runs automatically.

### Add features

Refer to [the Wiki](https://github.com/skychatorg/skychat/wiki) guides to contribute:
- [Write a plugin](https://github.com/skychatorg/skychat/wiki/SkyChat-Plugin-Development-Documentation)
- [Example: Write the TypingList Plugin](https://github.com/skychatorg/skychat/wiki/Room-Plugin-Example:-Writing-the-TypingList-Plugin)
- [Plugin hooks](https://github.com/skychatorg/skychat/wiki/SkyChat-Plugin-Hooks-Documentation)

Please use only one of the following to suggest new features (or bug fixes):
- Create a pull request
- Open an issue with your proposal
2 changes: 1 addition & 1 deletion app/server/plugins/RoomPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export abstract class RoomPlugin extends Plugin {
/**
* Get a summary of this plugin state to include in the room list
*/
public getRoomSummary(): null | undefined | any {
public getRoomSummary(): unknown {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion app/server/plugins/core/room/HelpPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class HelpPlugin extends RoomPlugin {
<td>${alias}</td>
<td>${command.minRight}</td>
<td>${coolDown}s</td>
<td>${(rules.params || []).map((param) => param.name).join(', ')}</td>
<td>${(rules.params ?? []).map((param) => param.name).join(', ')}</td>
</tr>
`;
}
Expand Down
6 changes: 2 additions & 4 deletions app/server/plugins/player/PlayerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,10 @@ export class PlayerPlugin extends GlobalPlugin {
throw new Error('You are not authorized to perform this action');
}
// Vote skip
// eslint-disable-next-line no-case-declarations
const playerData = channel.getPlayerData();
if (this.manager.getPlugin('poll') && playerData.current) {
if (this.manager.getPlugin('poll') && channel.getPlayerData().current) {
const poll = await (this.manager.getPlugin('poll') as PollPlugin).poll(
`${channel.name}: Skip media?`,
`${connection.session.identifier} wants to skip ${playerData.current.video.title}. Skip media?`,
`${connection.session.identifier} wants to skip ${channel.getPlayerData().current?.video.title}. Skip media?`,
{
audience: channel.sessions,
defaultValue: false,
Expand Down
2 changes: 1 addition & 1 deletion app/server/plugins/security_extra/MessageLimiterPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class MessageLimiterPlugin extends RoomPlugin {

// Send message to connection
const message = new Message({
content: 'Message limit: ' + (this.storage.maxSuccessiveChars === null ? 'off' : this.storage.maxSuccessiveChars),
content: 'Message limit: ' + (this.storage.maxSuccessiveChars ?? 'off'),
user: UserController.getNeutralUser(),
});
connection.send('message', message.sanitized());
Expand Down
2 changes: 1 addition & 1 deletion app/server/skychat/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export class Room implements IBroadcaster {
public sanitized(): SanitizedRoom {
const lastMessage: Message | null = this.messages.length === 0 ? null : this.messages[this.messages.length - 1];
// Merge summary data from every plugin
const plugins: { [pluginName: string]: string } = {};
const plugins: { [pluginName: string]: unknown } = {};
for (const plugin of this.plugins) {
const summary = plugin.getRoomSummary();
if (summary === null || typeof summary === 'undefined') {
Expand Down

0 comments on commit d1e7f15

Please sign in to comment.