00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "xhtmlim.h"
00015
00016 #include "tag.h"
00017
00018 namespace gloox
00019 {
00020
00021 XHtmlIM::XHtmlIM( const Tag* xhtml )
00022 : StanzaExtension( ExtXHtmlIM ), m_xhtml( 0 )
00023 {
00024 if( !xhtml|| xhtml->name() != "html" || xhtml->xmlns() != XMLNS_XHTML_IM )
00025 return;
00026
00027 if( !xhtml->hasChild( "body", XMLNS, "http://www.w3.org/1999/xhtml" ) )
00028 return;
00029
00030 m_xhtml = xhtml->clone();
00031 }
00032
00033 XHtmlIM::~XHtmlIM()
00034 {
00035 delete m_xhtml;
00036 }
00037
00038 const std::string& XHtmlIM::filterString() const
00039 {
00040 static const std::string filter = "/message/html[@xmlns='" + XMLNS_XHTML_IM + "']";
00041 return filter;
00042 }
00043
00044 Tag* XHtmlIM::tag() const
00045 {
00046 return m_xhtml->clone();
00047 }
00048
00049 }