QXmppSessionIq.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2008-2012 The QXmpp developers
  3. *
  4. * Authors:
  5. * Manjeet Dahiya
  6. * Jeremy Lainé
  7. *
  8. * Source:
  9. * http://code.google.com/p/qxmpp
  10. *
  11. * This file is a part of QXmpp library.
  12. *
  13. * This library is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU Lesser General Public
  15. * License as published by the Free Software Foundation; either
  16. * version 2.1 of the License, or (at your option) any later version.
  17. *
  18. * This library is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. * Lesser General Public License for more details.
  22. *
  23. */
  24. #include <QDomElement>
  25. #include <QXmlStreamWriter>
  26. #include "QXmppSessionIq.h"
  27. #include "QXmppConstants.h"
  28. #include "QXmppUtils.h"
  29. /// \cond
  30. bool QXmppSessionIq::isSessionIq(const QDomElement &element)
  31. {
  32. QDomElement sessionElement = element.firstChildElement("session");
  33. return (sessionElement.namespaceURI() == ns_session);
  34. }
  35. void QXmppSessionIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
  36. {
  37. writer->writeStartElement("session");;
  38. writer->writeAttribute("xmlns", ns_session);
  39. writer->writeEndElement();
  40. }
  41. /// \endcond