@@ -34,6 +34,8 @@ Strophe.addConnectionPlugin('chatstates',
3434 var composing = $ ( message ) . find ( 'composing' ) ,
3535 paused = $ ( message ) . find ( 'paused' ) ,
3636 active = $ ( message ) . find ( 'active' ) ,
37+ inactive = $ ( message ) . find ( 'inactive' ) ,
38+ gone = $ ( message ) . find ( 'gone' ) ,
3739 jid = $ ( message ) . attr ( 'from' ) ;
3840
3941 if ( composing . length > 0 )
@@ -51,6 +53,16 @@ Strophe.addConnectionPlugin('chatstates',
5153 $ ( document ) . trigger ( 'active.chatstates' , jid ) ;
5254 }
5355
56+ if ( inactive . length > 0 )
57+ {
58+ $ ( document ) . trigger ( 'inactive.chatstates' , jid ) ;
59+ }
60+
61+ if ( gone . length > 0 )
62+ {
63+ $ ( document ) . trigger ( 'gone.chatstates' , jid ) ;
64+ }
65+
5466 return true ;
5567 } ,
5668
@@ -69,6 +81,16 @@ Strophe.addConnectionPlugin('chatstates',
6981 this . _sendNotification ( jid , type , 'paused' ) ;
7082 } ,
7183
84+ sendInactive : function ( jid , type )
85+ {
86+ this . _sendNotification ( jid , type , 'inactive' ) ;
87+ } ,
88+
89+ sendGone : function ( jid , type )
90+ {
91+ this . _sendNotification ( jid , type , 'gone' ) ;
92+ } ,
93+
7294 _sendNotification : function ( jid , type , notification )
7395 {
7496 if ( ! type ) type = 'chat' ;
0 commit comments