@@ -5,11 +5,11 @@ import { toast } from 'src/utils/2.toasts.js';
55import { debug } from 'src/utils/debug.js' ;
66import each from 'src/utils/each.js' ;
77import { buttonCSS as css } from 'src/utils/1.variables.js' ;
8+ import { isMod , name as username } from 'src/utils/user' ;
89import 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
1313const busyMessage = ':me:is in do not disturb mode' ; // TODO: configurable?
1414const allow = 'Allow' ;
1515const 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
6666function 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