Package com.sissi.protocol.presence

Examples of com.sissi.protocol.presence.Presence


    JID group = super.build(protocol.getTo());
    Room room = this.room.build(group);
    if (!room.allowed(context.jid(), RoomConfig.CONFIGED)) {
      return true;
    }
    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


public class PresenceRosterSubscribed2PresenceProcessor extends ProxyProcessor {

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

   *
   * @param context
   * @param from
   */
  private void writeOffline(JIDContext context, JID from) {
    context.write(new Presence().setFrom(from).status(this.vCardContext.pull(from, VCardContext.FIELD_SIGNATURE).getValue()).type(PresenceType.UNAVAILABLE), true);
  }
View Full Code Here

   * @param from
   * @param resoures
   */
  private void writeOnlinePresence(JIDContext context, JID from, JIDs resoures) {
    for (JID resource : resoures) {
      context.write(new Presence().setFrom(resource).clauses(super.findOne(resource, true).status().clauses()), true);
    }
  }
View Full Code Here

  @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.protocol.presence.Presence

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.