Examples of Presence


Examples of com.sissi.protocol.presence.Presence

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

Examples of com.sissi.protocol.presence.Presence

public class PresenceRosterUnSubscribed2PresenceProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID to = super.build(protocol.getTo());
    Presence presence = protocol.cast(Presence.class).type(PresenceType.UNAVAILABLE);
    for (JID resource : super.resources(context.jid())) {
      super.broadcast(to, presence.setFrom(resource));
    }
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

    return this.writePresence(protocol.cast(Presence.class).clone(), context);
  }

  private boolean writePresence(Presence presence, JIDContext context) {
    for (JID resource : super.resources(context.jid())) {
      context.write(new Presence().setFrom(resource).clauses(super.findOne(resource, true).status().clauses()), true);
    }
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

   *
   * @see com.sissi.pipeline.Input#input(com.sissi.context.JIDContext, com.sissi.protocol.Protocol)
   */
  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Presence presence = Presence.muc();
    presence.findField(XMuc.NAME, XMuc.class).history(new History().setSince(this.format.format(Long.valueOf(this.vcardContext.pull(context.jid(), VCardContext.FIELD_LOGOUT, String.valueOf(System.currentTimeMillis())).getValue()))));
    for (JID jid : super.iSubscribedWho(context.jid())) {
      this.proxy.input(context, presence.setTo(jid));
    }
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.presence.Presence

  }

  private boolean writeAndReturn(JIDContext context, JID group, String nickname, MucRelation relation) {
    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.presence.Presence

*/
public class PresenceRosterUnSubscribe2PresenceProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Presence presence = protocol.cast(Presence.class).type(PresenceType.UNAVAILABLE);
    for (JID resource : super.resources(super.build(protocol.getTo()))) {
      super.broadcast(context.jid(), presence.setFrom(resource));
    }
    return true;
  }
View Full Code Here

Examples of edu.drexel.cs544.mcmuc.actions.Presence

    /**
     * Sends the user's per-room status out to the Room channel
     */
    private void sendStatus() {
        if (this.keyPairs.keySet().isEmpty()) {
            this.send(new Presence(this.getUserName(), roomPresence));
        } else {
            this.send(new Presence(this.getUserName(), roomPresence, new ArrayList<Certificate>(keyPairs.keySet())));
        }
    }
View Full Code Here

Examples of edu.drexel.cs544.mcmuc.actions.Presence

        if (actionString.equalsIgnoreCase(Message.action)) {
            action = new Message(jo);
            action.process(this);
        } else if (actionString.equalsIgnoreCase(Presence.action)) {
            try {
                action = new Presence(jo);
                action.process(this);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (actionString.equalsIgnoreCase(PollPresence.action)) {
View Full Code Here

Examples of jabber.client.Presence

        }
        return answer;
    }

    protected void sendPresence(Presence presence, org.jabber.protocol.muc_user.Item item) throws IOException {
        Presence answer = new Presence();
        answer.setFrom(presence.getTo());
        answer.setType(presence.getType());
        answer.setTo(presence.getFrom());
        X x = new X();
        x.getDeclineOrDestroyOrInvite().add(item);
        answer.getShowOrStatusOrPriority().add(x);
        transport.marshall(answer);
    }
View Full Code Here

Examples of net.solosky.maplefetion.bean.Presence

   */
  @Override
  protected ActionEvent doActionOK(SipcResponse response)
      throws FetionException
  {
    Presence prensence = this.context.getFetionUser().getPresence();
    BeanHelper.setValue(prensence, "value", this.presence);
    return super.doActionOK(response);
  }
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.