14 #include "messageeventfilter.h"
15 #include "messageeventhandler.h"
16 #include "messagesession.h"
23 :
MessageFilter( parent ), m_messageEventHandler( 0 ), m_requestedEvents( 0 ),
47 if( x && m_messageEventHandler )
49 if( stanza->
body().empty() )
53 else if( x->
hasChild(
"delivered" ) )
55 else if( x->
hasChild(
"displayed" ) )
57 else if( x->
hasChild(
"composing" ) )
65 m_requestedEvents = 0;
77 else if( stanza->
body().empty() )
79 m_requestedEvents = 0;
86 if( m_disable || ( !( m_requestedEvents & event ) && ( event !=
MessageEventCancel ) ) )
89 Tag *m =
new Tag(
"message" );
91 Tag *x =
new Tag( m,
"x" );
93 new Tag( x,
"id", m_lastID );
99 new Tag( x,
"offline" );
100 m_requestedEvents &= ~event;
103 new Tag( x,
"delivered" );
104 m_requestedEvents &= ~event;
107 new Tag( x,
"displayed" );
108 m_requestedEvents &= ~event;
112 new Tag( x,
"composing" );
133 if( m_defaultEvents != 0 )
135 Tag *x =
new Tag( tag,
"x" );
139 new Tag( x,
"offline" );
141 new Tag( x,
"delivered" );
143 new Tag( x,
"displayed" );
145 new Tag( x,
"composing" );
152 m_messageEventHandler = meh;
157 m_messageEventHandler = 0;