Exemplo n.º 1
0
 public Iq reply() {
   Iq reply = new Iq();
   reply.from = to;
   reply.to = from;
   reply.id = this.id;
   reply.type = Type.result;
   return reply;
 }
Exemplo n.º 2
0
  public static Iq parse(XmlPullParser parser) throws XmlPullParserException, java.io.IOException {
    Iq iq = new Iq();
    iq.parseStanza(parser);

    while (parser.next() == XmlPullParser.START_TAG) {
      final String xmlns = parser.getNamespace();
      if (xmlns != null) {
        ChildElement child = Stanza.parseChild(xmlns, parser);
        if (child != null) {
          iq.addChild(child);
        } else {
          XmlUtils.skip(parser);
        }
      } else {
        XmlUtils.skip(parser);
      }
    }
    return iq;
  }