Examples of Presence


Examples of com.sissi.protocol.presence.Presence

*/
abstract class ToSelfsPresenceProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Presence presence = new Presence();
    for (BlockListItem item : protocol.cast(Block.class).getItem()) {
      JID to = super.build(item.getJid());
      for (JID resource : super.resources(to)) {
        // super.findOne(to, true, true) -> Block.item.jid指定资源的JIDContext
        super.broadcast(context.jid(), presence.setFrom(resource).clauses(this.build(super.findOne(to, true, true)).clauses()));
      }
    }
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

  private static class DefaultPresenceBuilder implements PresenceBuilder {

    @Override
    public Presence build(JID from, Status status) {
      return status.getClass() == Presence.class ? Presence.class.cast(status).setFrom(from) : new Presence().setFrom(from).clauses(status.clauses());
    }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

public class MucOwnerDestoryLeaveProcessor extends ProxyProcessor {

  @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

Examples of com.sissi.protocol.presence.Presence

    this.proxy = proxy;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    this.proxy.input(context, new Presence().type(PresenceType.SUBSCRIBE).setTo(protocol.cast(Roster.class).first().getJid()));
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

    this.proxy = proxy;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Presence presence = Presence.muc();
    presence.findField(XMuc.NAME, XMuc.class).set(History.NAME, protocol.cast(Message.class).getHistory());
    return this.proxy.input(context, presence.setTo(protocol.getTo()));
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

    this.relationContext = relationContext;
  }

  @Override
  public MucGetout getout(JIDContext context) {
    Presence presence = new Presence();
    for (JID group : this.relationContext.iSubscribedWho(context.jid())) {
      this.proxy.input(context, presence.setTo(group).type(PresenceType.UNAVAILABLE));
    }
    return this;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

    this.vCardContext = vCardContext;
  }

  @Override
  public PresenceGetout getout(JIDContext context) {
    this.proxy.input(context, new Presence().setFrom(context.jid()).status(this.vCardContext.pull(context.jid(), VCardContext.FIELD_SIGNATURE).getValue()).type(PresenceType.UNAVAILABLE));
    return this;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

    return this;
  }

  private Presence presence(XMucAdminAction action, String affiliation) {
    this.limit = !ItemAffiliation.parse(this.getAffiliation()).contains(affiliation);
    return new Presence().setType(this.limit ? PresenceType.UNAVAILABLE.toString() : XMucAdminAction.AFFILIATION == action ? ItemAffiliation.parse(this.getAffiliation()).presence() : ItemRole.parse(this.getRole()).presence()).setFrom(this.group).cast(Presence.class);
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    if (context.onlined()) {
      Presence presence = protocol.cast(Presence.class).clone();
      for (JID group : super.iSubscribedWho(context.jid())) {
        this.proxy.input(context, presence.setTo(group));
      }
    }
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

*/
public class PresenceProbeOnlineProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Presence presence = protocol.cast(Presence.class);
    for (JID resource : super.resources(super.build(protocol.getTo()))) {
      super.findOne(resource, true).write(presence.setFrom(context.jid()).clauses(super.findOne(resource, true).status().clauses()).type(PresenceType.PROBE));
    }
    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.