@@ -151,6 +151,11 @@ var chatSetAttr = chatSetAttr || (function () {
151
151
return msg . content ;
152
152
}
153
153
} ,
154
+ notifyAboutDelay = function ( whisper ) {
155
+ const chatFunction = ( ) => sendChatMessage ( whisper + 'Your command is taking a ' +
156
+ 'long time to execute. Please be patient, the process will finish eventually.' ) ;
157
+ return setTimeout ( chatFunction , 8000 ) ;
158
+ } ,
154
159
getCIKey = function ( obj , name ) {
155
160
const nameLower = name . toLowerCase ( ) ;
156
161
let result = false ;
@@ -198,7 +203,8 @@ var chatSetAttr = chatSetAttr || (function () {
198
203
// Setting attributes happens in a delayed recursive way to prevent the sandbox
199
204
// from overheating.
200
205
delayedGetAndSetAttributes = function ( whisper , list , setting , errors , rData , opts ) {
201
- const cList = [ ] . concat ( list ) ,
206
+ const timeNotification = notifyAboutDelay ( whisper ) ,
207
+ cList = [ ] . concat ( list ) ,
202
208
feedback = [ ] ,
203
209
dWork = function ( charid ) {
204
210
const attrs = getCharAttributes ( charid , setting , errors , rData , opts ) ;
@@ -207,6 +213,7 @@ var chatSetAttr = chatSetAttr || (function () {
207
213
setTimeout ( dWork , 50 , cList . shift ( ) ) ;
208
214
}
209
215
else {
216
+ clearTimeout ( timeNotification ) ;
210
217
if ( ! opts . mute ) handleErrors ( whisper , errors ) ;
211
218
if ( ! opts . silent ) sendFeedback ( whisper , feedback , opts ) ;
212
219
}
@@ -431,7 +438,8 @@ var chatSetAttr = chatSetAttr || (function () {
431
438
} ,
432
439
// Deleting attributes
433
440
delayedDeleteAttributes = function ( whisper , list , setting , errors , rData , opts ) {
434
- const cList = [ ] . concat ( list ) ,
441
+ const timeNotification = notifyAboutDelay ( whisper ) ,
442
+ cList = [ ] . concat ( list ) ,
435
443
feedback = { } ,
436
444
dWork = function ( charid ) {
437
445
const attrs = getCharAttributes ( charid , setting , errors , rData , opts ) ;
@@ -441,6 +449,7 @@ var chatSetAttr = chatSetAttr || (function () {
441
449
setTimeout ( dWork , 50 , cList . shift ( ) ) ;
442
450
}
443
451
else {
452
+ clearTimeout ( timeNotification ) ;
444
453
if ( ! opts . silent ) sendDeleteFeedback ( whisper , feedback , opts ) ;
445
454
}
446
455
}
@@ -625,7 +634,7 @@ var chatSetAttr = chatSetAttr || (function () {
625
634
sendChatMessage ( output , opts [ 'fb-from' ] ) ;
626
635
} ,
627
636
sendDeleteFeedback = function ( whisper , feedback , opts ) {
628
- const output = ( opts [ 'fb-public' ] ? '' : whisper ) +
637
+ let output = ( opts [ 'fb-public' ] ? '' : whisper ) +
629
638
'<div style="border:1px solid black;background-color:#FFFFFF;padding:3px;">' +
630
639
'<h3>' + ( ( 'fb-header' in opts ) ? opts [ 'fb-header' ] : 'Deleting attributes' ) + '</h3><p>' ;
631
640
output += Object . entries ( feedback )
0 commit comments