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>
6464 defaultSupportPic : 'http://lorempixel.com/100/100/people' ,
6565 onMessage : myFunction ,
6666 onSend : function ( msg , key ) {
67- console . log ( 'Sent message. Id stored: ' + key ) ;
67+ console . log ( '#################' ) ;
68+ console . log ( '- Message sent! Key: ' + key ) ;
6869 console . log ( msg )
70+ console . log ( '#################' ) ;
6971 }
7072 } ) ;
7173
7274 function myFunction ( message , key ) {
7375 console . log ( '--------------------' ) ;
74- console . log ( '- We got a message!' ) ;
76+ console . log ( '- We got a message! key: ' + key ) ;
7577 console . log ( message ) ;
76- console . log ( '- key:' ) ;
77- console . log ( key ) ;
7878 console . log ( '--------------------' ) ;
7979 }
8080 } ;
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ function IASChat(config) {
333333
334334 if ( message . uid == uid ) {
335335 printMessage ( text ) ;
336- if ( typeof onSend === 'function' ) {
336+ if ( typeof onSend === 'function' && message . timestamp > lastMessage . timestamp ) {
337337 onSend ( message , key ) ;
338338 }
339339 } else {
@@ -344,7 +344,7 @@ function IASChat(config) {
344344 readLastMessage ( ) ;
345345 }
346346
347- if ( typeof onMessage === 'function' ) {
347+ if ( typeof onMessage === 'function' && message . timestamp > lastMessage . timestamp ) {
348348 onMessage ( message , key ) ;
349349 }
350350 }
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ function IASChat(config) {
333333
334334 if ( message . uid == uid ) {
335335 printMessage ( text ) ;
336- if ( typeof onSend === 'function' ) {
336+ if ( typeof onSend === 'function' && message . timestamp > lastMessage . timestamp ) {
337337 onSend ( message , key ) ;
338338 }
339339 } else {
@@ -344,7 +344,7 @@ function IASChat(config) {
344344 readLastMessage ( ) ;
345345 }
346346
347- if ( typeof onMessage === 'function' ) {
347+ if ( typeof onMessage === 'function' && message . timestamp > lastMessage . timestamp ) {
348348 onMessage ( message , key ) ;
349349 }
350350 }
You can’t perform that action at this time.
0 commit comments