File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -64,17 +64,17 @@ <h1>User side support</h1>
64
64
defaultSupportPic : 'http://lorempixel.com/100/100/people' ,
65
65
onMessage : myFunction ,
66
66
onSend : function ( msg , key ) {
67
- console . log ( 'Sent message. Id stored: ' + key ) ;
67
+ console . log ( '#################' ) ;
68
+ console . log ( '- Message sent! Key: ' + key ) ;
68
69
console . log ( msg )
70
+ console . log ( '#################' ) ;
69
71
}
70
72
} ) ;
71
73
72
74
function myFunction ( message , key ) {
73
75
console . log ( '--------------------' ) ;
74
- console . log ( '- We got a message!' ) ;
76
+ console . log ( '- We got a message! key: ' + key ) ;
75
77
console . log ( message ) ;
76
- console . log ( '- key:' ) ;
77
- console . log ( key ) ;
78
78
console . log ( '--------------------' ) ;
79
79
}
80
80
} ;
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ function IASChat(config) {
333
333
334
334
if ( message . uid == uid ) {
335
335
printMessage ( text ) ;
336
- if ( typeof onSend === 'function' ) {
336
+ if ( typeof onSend === 'function' && message . timestamp > lastMessage . timestamp ) {
337
337
onSend ( message , key ) ;
338
338
}
339
339
} else {
@@ -344,7 +344,7 @@ function IASChat(config) {
344
344
readLastMessage ( ) ;
345
345
}
346
346
347
- if ( typeof onMessage === 'function' ) {
347
+ if ( typeof onMessage === 'function' && message . timestamp > lastMessage . timestamp ) {
348
348
onMessage ( message , key ) ;
349
349
}
350
350
}
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ function IASChat(config) {
333
333
334
334
if ( message . uid == uid ) {
335
335
printMessage ( text ) ;
336
- if ( typeof onSend === 'function' ) {
336
+ if ( typeof onSend === 'function' && message . timestamp > lastMessage . timestamp ) {
337
337
onSend ( message , key ) ;
338
338
}
339
339
} else {
@@ -344,7 +344,7 @@ function IASChat(config) {
344
344
readLastMessage ( ) ;
345
345
}
346
346
347
- if ( typeof onMessage === 'function' ) {
347
+ if ( typeof onMessage === 'function' && message . timestamp > lastMessage . timestamp ) {
348
348
onMessage ( message , key ) ;
349
349
}
350
350
}
You can’t perform that action at this time.
0 commit comments