Package com.sissi.protocol.iq.register.simple

Examples of com.sissi.protocol.iq.register.simple.Username


  public boolean input(JIDContext context, Protocol protocol) {
    return context.binding() ? this.writeAndReturn(context, protocol) : true;
  }

  private boolean writeAndReturn(JIDContext context, Protocol protocol) {
    context.write(protocol.cast(Register.class).clear().add(Registered.FIELD).add(new Username().setText(context.jid().user())).parent().reply().setType(ProtocolType.RESULT).setFrom(OfflineJID.OFFLINE));
    return false;
  }
View Full Code Here


  private final Error error = new ServerError().type(ProtocolType.CANCEL).add(NotAcceptable.DETAIL);

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Username username = protocol.cast(Register.class).findField(Username.NAME, Username.class);
    return username != null && username.valid() ? true : this.writeAndReturn(context, protocol);
  }
View Full Code Here

TOP

Related Classes of com.sissi.protocol.iq.register.simple.Username

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.