Skip to content

Commit f94f9e6

Browse files
committed
fix: broken user code
1 parent a14920e commit f94f9e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/base/streamer/message.private.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { toast } from 'src/utils/2.toasts.js';
55
import { debug } from 'src/utils/debug.js';
66
import each from 'src/utils/each.js';
77
import { buttonCSS as css } from 'src/utils/1.variables.js';
8+
import { isMod, name as username } from 'src/utils/user';
89
import streaming from './0.streamer.js';
910

10-
/* eslint-disable no-multi-assign */
1111
// Toast for private messages while streaming mode is on
12-
12+
// TODO: translation
1313
const busyMessage = ':me:is in do not disturb mode'; // TODO: configurable?
1414
const allow = 'Allow';
1515
const hide = 'Hide';
@@ -34,7 +34,7 @@ eventManager.on('preChat:getPrivateMessage', function streamerMode(data) {
3434
const message = JSON.parse(data.chatMessage);
3535
const user = message.user;
3636

37-
if (user.isMod(user)) return; // Moderators are always allowed
37+
if (isMod(user)) return; // Moderators are always allowed
3838

3939
this.canceled = true; // Cancel the event from going through
4040

@@ -49,7 +49,7 @@ eventManager.on('preChat:getPrivateMessage', function streamerMode(data) {
4949

5050
if (val === silent || toasts[userId]) return; // Don't announce anymore
5151
toasts[userId] = toast({
52-
text: `Message from ${user.name(user)}`,
52+
text: `Message from ${username(user)}`,
5353
buttons: [{
5454
css,
5555
text: 'Open',
@@ -65,7 +65,7 @@ eventManager.on(':unload', closeAll);
6565

6666
function open(user) {
6767
const { id } = user;
68-
global('openPrivateRoom')(id, user.name(user).replace('\'', ''));
68+
global('openPrivateRoom')(id, username(user).replace('\'', ''));
6969
delete toasts[id];
7070
}
7171

0 commit comments

Comments
 (0)