Examples of MucRelation


Examples of com.sissi.ucenter.relation.muc.MucRelation

    JID group = super.build(protocol.parent().getTo());
    Room room = this.room.build(group);
    for (Item item : protocol.cast(XMucAdmin.class).getItem()) {
      // 同Nickname多JID
      for (JID each : this.mapping.mapping(item.actor(context.jid()).group(group))) {
        MucRelation relation = super.ourRelation(each, group).cast(MucRelation.class);
        for (JID to : super.whoSubscribedMe(group)) {
          super.findOne(to, true).write(item.presence().add(this.judger.add(new XUser(group, to, room.allowed(to, RoomConfig.WHOISEXISTS)).item(item.hidden(room.allowed(to, RoomConfig.WHOISALLOW, each)).relation(relation.cast(MucRelation.class).role(item.getRole(), true)).actor(context.jid()))).cast(XUser.class)));
        }
      }
    }
    return true;
  }
View Full Code Here

Examples of com.sissi.ucenter.relation.muc.MucRelation

  }

  @Override
  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);
        }
      }
    }
    return true;
View Full Code Here

Examples of com.sissi.ucenter.relation.muc.MucRelation

    this.proxy = proxy;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    MucRelation relation = super.ourRelation(context.jid(), super.build(protocol.parent().getTo())).cast(MucRelation.class);
    return relation.activate() && !relation.outcast() ? true : this.proxy.input(context, protocol.parent());
  }
View Full Code Here

Examples of com.sissi.ucenter.relation.muc.MucRelation

  private final Error error = new ServerError().type(ProtocolType.AUTH).add(Forbidden.DETAIL);

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    MucRelation relation = super.ourRelation(context.jid(), super.build(protocol.parent().getTo())).cast(MucRelation.class);
    return relation.activate() && ItemAffiliation.OWNER.equals(relation.affiliation()) ? true : this.writeAndReturn(context, protocol);
  }
View Full Code Here

Examples of com.sissi.ucenter.relation.muc.MucRelation

  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    MucRelation relation = super.ourRelation(context.jid(), group).cast(MucRelation.class).noneRole();
    Room room = this.room.build(group);
    Presence presence = new Presence();
    for (Relation each : super.myRelations(group)) {
      JID to = super.build(each.cast(MucRelation.class).jid());
      super.findOne(to, true).write(presence.clear().add(this.judger.add(new XUser(group, to, room.allowed(to, RoomConfig.WHOISEXISTS)).item(new Item(room.allowed(to, RoomConfig.WHOISALLOW, context.jid()), relation))).cast(XUser.class)).type(PresenceType.UNAVAILABLE).setFrom(protocol.getTo()));
View Full Code Here

Examples of com.sissi.ucenter.relation.muc.MucRelation

  @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

Examples of com.sissi.ucenter.relation.muc.MucRelation

    Room room = this.room.build(group);
    if (!room.allowed(context.jid(), RoomConfig.CONFIGED)) {
      return true;
    }
    Presence presence = new Presence();
    MucRelation relation = super.ourRelation(context.jid(), group).cast(MucRelation.class);
    for (Relation each : super.myRelations(group)) {
      JID to = super.build(each.jid());
      super.findOne(to, true).write(presence.clear().clauses(context.status().clauses()).add(this.judger.add(new XUser(group, to, room.allowed(to, RoomConfig.WHOISEXISTS)).item(new Item(room.allowed(to, RoomConfig.WHOISALLOW, context.jid()), relation))).cast(XUser.class)).setFrom(protocol.getTo()));
    }
    return true;
View Full Code Here

Examples of com.sissi.ucenter.relation.muc.MucRelation

  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    Room room = this.room.build(group);
    Presence presence = new Presence();
    for (Relation each : super.myRelations(group)) {
      MucRelation relation = each.cast(MucRelation.class);
      JID to = super.build(relation.jid());
      context.write(presence.clear().clauses(super.findOne(to, true).status().clauses()).add(this.judeger.add(new XUser(group, context.jid(), room.allowed(context.jid(), RoomConfig.WHOISEXISTS)).item(new Item(room.allowed(context.jid(), RoomConfig.WHOISALLOW, to), relation))).cast(XUser.class)).setFrom(group.resource(relation.name())));
    }
    return 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.