Package com.sissi.protocol.muc

Examples of com.sissi.protocol.muc.Item


  public boolean input(JIDContext context, Protocol protocol) {
    XMucAdmin admin = protocol.cast(XMucAdmin.class);
    JID group = super.build(admin.clear().parent().getTo());
    for (Relation relation : this.relationContext.myRelations(group, admin.affiliation())) {
      // Always not hidden, 永远显示JID
      admin.add(new Item(false, relation.cast(MucRelation.class)));
    }
    context.write(protocol.parent().reply().setType(ProtocolType.RESULT));
    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

    }
    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

    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

    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

    }
    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

    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

Related Classes of com.sissi.protocol.muc.Item

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.