Examples of XUser


Examples of com.sissi.protocol.muc.XUser

    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.protocol.muc.XUser

   * @see com.sissi.persistent.impl.PersistentMessage#read(java.util.Map)
   */
  @Override
  public Message read(Map<String, Object> element) {
    Message message = Message.class.cast(super.read(element, new Message()));
    return message.muc(new XUser().invite(new Invite().reason(super.toString(element, Dictionary.FIELD_REASON)).continued(super.toString(element, Dictionary.FIELD_CONTINUE)).setFrom(element.get(Dictionary.FIELD_INVITE).toString()))).delay(super.delay(element, message)).request(Boolean.valueOf(element.get(Dictionary.FIELD_ACK).toString()));
  }
View Full Code Here

Examples of com.sissi.protocol.muc.XUser

    this.extracter = extracter;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    XUser user = this.extracter.extract(protocol.cast(Owner.class).getX(), new XUser()).cast(XUser.class);
    if (user.contain()) {
      JID group = super.build(protocol.parent().getTo());
      Protocol message = new Message().noneThread().muc(user).setType(MessageType.GROUPCHAT).setFrom(group);
      for (JID jid : super.whoSubscribedMe(group)) {
        super.findOne(jid, true).write(message);
      }
View Full Code Here

Examples of com.sissi.protocol.muc.XUser

  @Override
  public AffiliationBroadcast broadcast(JID group, Room room, MucItem item, JIDContext invoker) {
    // 岗位限制则发出加入邀请
    if (!room.allowed(this.jidBuilder.build(item.getJid()), RoomConfig.AFFILIATIONALLOW)) {
      // Message.to = group, Invite.to = item.jid
      this.proxy.input(invoker, new Message().muc(new XUser().invite(new Invite().setTo(item.getJid()))).setTo(group));
    }
    return this;
  }
View Full Code Here

Examples of com.sissi.protocol.muc.XUser

  public AffiliationBroadcast broadcast(JID group, Room room, MucItem item, JIDContext invoker) {
    JID jid = this.jidBuilder.build(item.getJid());
    // 向MUC房客广播MUC JID所有资源岗位变更
    for (Relation relation : this.relationContext.ourRelations(jid, group)) {
      for (JID to : this.relationContext.whoSubscribedMe(group)) {
        this.addressing.findOne(to, true).write(item.presence(room.pull(Dictionary.FIELD_AFFILIATION, String.class)).add(this.adder.add(new XUser(group, to, room.allowed(to, RoomConfig.WHOISEXISTS, null)).item(item.hidden(room.allowed(to, RoomConfig.WHOISALLOW, jid)).relation(relation.cast(MucRelation.class).affiliation(item.getAffiliation(), true)))).cast(XUser.class)));
      }
    }
    return this;
  }
View Full Code Here

Examples of com.sissi.protocol.muc.XUser

    }
    return this;
  }

  public Presence destory(Destory destory) {
    return this.type(PresenceType.UNAVAILABLE).add(new XUser().destory(destory).item(new Item().setAffiliation(ItemAffiliation.NONE.toString()).setRole(ItemRole.NONE.toString())));
  }
View Full Code Here

Examples of com.sissi.protocol.muc.XUser

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

Examples of com.sissi.protocol.muc.XUser

    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.adder.add(new XUser(group, to, room.allowed(to, RoomConfig.WHOISEXISTS)).item(new Item(room.allowed(to, RoomConfig.WHOISALLOW, context.jid()), nickname, relation))).cast(XUser.class)).type(PresenceType.UNAVAILABLE).setFrom(group.resource(relation.name())));
    }
    return false;
  }
View Full Code Here

Examples of com.sissi.protocol.muc.XUser

    }
    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.protocol.muc.XUser

    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.