Package com.sissi.context

Examples of com.sissi.context.JID


*/
public class PresenceMucJoinProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    super.establish(context.jid(), new PresenceWrapRelation(group, protocol.cast(Presence.class).findField(XMuc.NAME, XMuc.class), super.ourRelation(context.jid(), group).cast(MucRelation.class)));
    return true;
  }
View Full Code Here


    this.proxy = proxy;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID to = super.build(protocol.getTo());
    return super.ourRelation(context.jid(), to).cast(RosterRelation.class).in(this.relations) ? this.writeAndReturn(context, to, Presence.class.cast(protocol)) : true;
  }
View Full Code Here

    this.body = new Body(message);
  }

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

   */
  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    XMuc x = protocol.cast(Presence.class).findField(XMuc.NAME, XMuc.class);
    if (x.hasHistory()) {
      JID group = super.build(protocol.getTo());
      Room room = this.room.build(group);
      for (Element message : this.recover.pull(group, x.history())) {
        Delay delay = Message.class.cast(message).getDelay();
        delay.setFrom(room.allowed(context.jid(), RoomConfig.WHOISALLOW, super.build(delay.getFrom())) ? super.build(message.getFrom()).asStringWithBare() : delay.getFrom());
        context.write(message);
View Full Code Here

*/
public class PresenceRosterSubscribed2ItemProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID to = super.build(protocol.getTo());
    super.broadcast(to, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(super.ourRelation(to, context.jid()).cast(RosterRelation.class)))).setType(ProtocolType.SET));
    return true;
  }
View Full Code Here

    this.judeger = judeger;
  }

  @Override
  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

Related Classes of com.sissi.context.JID

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.