Package com.sissi.context

Examples of com.sissi.context.JID.resource()


  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    // 重定向From为MUC JID
    protocol.setFrom(group.resource(super.ourRelation(context.jid(), group).name()));
    for (JID jid : super.whoSubscribedMe(group)) {
      super.findOne(jid, true).write(protocol);
    }
    return true;
  }
View Full Code Here


  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    MucRelation relation = super.ourRelation(context.jid(), group).cast(MucRelation.class);
    for (Item item : protocol.cast(XMucAdmin.class).getItem()) {
      // 同Nickname多JID
      for (JID jid : this.mapping.mapping(group.resource(item.getNick()))) {
        if (ItemRole.parse(super.ourRelation(jid, group).cast(MucRelation.class).role()).contains(relation.role())) {
          return this.writeAndReturn(context, protocol);
        }
      }
    }
View Full Code Here

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    for (Item item : protocol.cast(XMucAdmin.class).getItem()) {
      this.role.build(item.getRole()).change(group.resource(item.getNick()));
    }
    return true;
  }
}
View Full Code Here

    XMucAdmin admin = protocol.cast(XMucAdmin.class);
    JID group = super.build(admin.clear().parent().getTo());
    Room room = this.room.build(group);
    for (Relation relation : this.relationContext.myRelations(group, admin.role())) {
      // 根据房间配置 可选的JID
      admin.add(new Item(room.allowed(context.jid(), RoomConfig.WHOISALLOW, group.resource(relation.name())), relation.cast(MucRelation.class)));
    }
    context.write(protocol.parent().reply().setType(ProtocolType.RESULT));
    return true;
  }
}
View Full Code Here

  }

  @Override
  protected VCard get(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    return super.vcardContext.pull(group.resource(this.mapping.mapping(group).jid().asStringWithBare()), protocol.cast(VCard.class));
  }
}
View Full Code Here

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    Presence presence = new Presence().destory(protocol.cast(Owner.class).getDestory());
    for (JID jid : super.whoSubscribedMe(super.build(protocol.parent().getTo()))) {
      super.findOne(jid, true).write(presence.setFrom(group.resource(super.ourRelation(jid, group).name())));
    }
    return true;
  }
}
View Full Code Here

  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    this.persistent.push(protocol.parent().setFrom(group.resource(super.ourRelation(context.jid(), group).name())));
    return true;
  }
}
View Full Code Here

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    String subject = room.build(group).pull(Dictionary.FIELD_SUBJECT, String.class);
    if (subject != null) {
      context.write(new Message().noneThread().subject(new Subject(subject)).setType(MessageType.GROUPCHAT).setFrom(group.resource(super.ourRelation(context.jid(), group).name())));
    }
    return true;
  }
}
View Full Code Here

  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    return this.room.build(group).allowed(context.jid(), RoomConfig.CHANGENICK, group.resource()) ? this.writeAndReturn(context, protocol) : true;
  }

  private boolean writeAndReturn(JIDContext context, Protocol protocol) {
    context.write(protocol.parent().reply().setError(this.error));
    return false;
View Full Code Here

  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    String nickname = group.resource();
    MucRelation relation = super.ourRelation(context.jid(), group).cast(MucRelation.class);
    // relation.activate(),如果已进入房间. group.resource().equals(relation.name()), 昵称未变
    return relation.activate() ? group.resource().equals(relation.name()) ? this.resend ? this.proxy.input(context, protocol) : false : this.writeAndReturn(context, group, nickname, relation) : true;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.