Examples of Jid


Examples of com.google.appengine.api.xmpp.JID

    String message = req.getParameter("message");
    if (message == null) {
      message = "Message vide";
    }

    JID jid = new JID("remi.bastide@gmail.com");

    Message msg = new MessageBuilder().withRecipientJids(jid)
        .withBody(message).build();

    boolean messageSent = false;
View Full Code Here

Examples of com.nabalive.server.jabber.util.Jid

    Pattern statusChangePattern = Pattern.compile("<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>([^<]*)</resource></bind>");

    public void onMessage(ChannelHandlerContext ctx, MessageEvent e, Status status, String message, Document document) {
        String id = document.getDocumentElement().getAttribute("id");
        String from = document.getDocumentElement().getAttribute("from");
        Jid jid = new Jid(from);

        String to = document.getDocumentElement().getAttribute("to");
        final Matcher matcher = statusChangePattern.matcher(message);
        if (matcher.find()) {
            String resource = matcher.group(1);
            logger.info("change status: " + resource);
            String reply = "<iq id='" + id + "' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>" +
                    "<jid>" + jid.getUser() + "@" + jid.getServer() + "/" + resource + "</jid></bind></iq>";
            write(e.getChannel(), reply);
            jid.setResource(resource);
            status.setJid(jid);
            status.onEvent(new Event(message, Event.Type.BIND_RESOURCE));

        } else if (message.contains("<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>")) {
            String reply = "<iq id='" + id + "' type='result' from='" + to + "'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>";
View Full Code Here

Examples of com.sissi.context.JID

    return false;
  }

  private Roster prepare(JIDContext context, Roster roster) {
    for (Relation each : super.myRelations(context.jid())) {
      JID to = super.build(each.jid());
      roster.add(new GroupItem(each.cast(RosterRelation.class)).nickname(this.vcardContext.pull(to, VCardContext.FIELD_NICK).getValue(), to.user()));
    }
    return roster;
  }
View Full Code Here

Examples of com.sissi.context.JID

    this.relationContext = relationContext;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    if (this.requestContext.apply(context.jid(), group, protocol.cast(Message.class).noneThread().subject(this.subject).getData())) {
      for (Relation relation : this.relationContext.myRelations(group, ItemRole.MODERATOR.toString())) {
        super.findOne(super.build(relation.jid()), true).write(protocol.reply());
      }
    }
View Full Code Here

Examples of com.sissi.context.JID

*/
public class MessageMuc2AllProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    // 重定向From为MUC JID
    protocol.setFrom(group.resource(super.ourRelation(context.jid(), group).name()));
    for (JID jid : super.whoSubscribedMe(group)) {
      super.findOne(jid, true).write(protocol);
    }
    return true;
  }
View Full Code Here

Examples of com.sissi.context.JID

public class RosterRemove2FansPresenceProcessor extends ProxyProcessor {

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

Examples of com.sissi.context.JID

    this.mapping = mapping;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    Room room = this.room.build(group);
    for (Item item : protocol.cast(XMucAdmin.class).getItem()) {
      // 同Nickname多JID
      for (JID each : this.mapping.mapping(item.actor(context.jid()).group(group))) {
        MucRelation relation = super.ourRelation(each, group).cast(MucRelation.class);
View Full Code Here

Examples of com.sissi.context.JID

    entity.put(Dictionary.FIELD_PID, element.getId());
    entity.put(Dictionary.FIELD_TYPE, element.getType());
    entity.put(Dictionary.FIELD_TIMESTAMP, System.currentTimeMillis());
    entity.put(Dictionary.FIELD_DELAY, this.format.format(new Date()));
    entity.put(Dictionary.FIELD_CLASS, element.getClass().getSimpleName());
    JID to = this.jidBuilder.build(element.getTo());
    JID from = this.jidBuilder.build(element.getFrom());
    entity.put(Dictionary.FIELD_TO, this.bare ? to.asStringWithBare() : to.asString());
    entity.put(Dictionary.FIELD_FROM, this.bare ? from.asStringWithBare() : from.asString());
    return entity;
  }
View Full Code Here

Examples of com.sissi.context.JID

   * @param element
   * @param message
   * @return
   */
  protected Delay delay(JID jid, Map<String, Object> element, Message message) {
    JID group = super.jidBuilder.build(element.get(Dictionary.FIELD_TO).toString());
    return new Delay(super.tip, this.room.build(group).allowed(jid, RoomConfig.WHOISALLOW, group) ? null : element.get(Dictionary.FIELD_SOURCE).toString(), element.get(Dictionary.FIELD_DELAY).toString());
  }
View Full Code Here

Examples of com.sissi.context.JID

    this.mapping = mapping;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    MucRelation relation = super.ourRelation(context.jid(), group).cast(MucRelation.class);
    for (Item item : protocol.cast(XMucAdmin.class).getItem()) {
      // 同Nickname多JID
      for (JID jid : this.mapping.mapping(group.resource(item.getNick()))) {
        if (ItemRole.parse(super.ourRelation(jid, group).cast(MucRelation.class).role()).contains(relation.role())) {
          return this.writeAndReturn(context, protocol);
        }
      }
    }
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.