Package com.sissi.protocol.muc

Examples of com.sissi.protocol.muc.Invite


   * Super.write plus {"invite":invite.from,"reason":invite.reason,"continue":invite.continued,"type":"invite"}
   *
   * @see com.sissi.persistent.impl.PersistentMessage#write(com.sissi.protocol.Element)
   */
  public Map<String, Object> write(Element element) {
    Invite invite = Message.class.cast(element).getMuc().getInvite();
    Map<String, Object> entity = super.write(element);
    entity.put(Dictionary.FIELD_INVITE, invite.getFrom());
    entity.put(Dictionary.FIELD_REASON, invite.reason());
    entity.put(Dictionary.FIELD_CONTINUE, invite.continued());
    entity.put(Dictionary.FIELD_TYPE, Dictionary.FIELD_INVITE);
    return entity;
  }
View Full Code Here


   * @see com.sissi.persistent.impl.PersistentMessage#read(java.util.Map)
   */
  @Override
  public Message read(Map<String, Object> element) {
    Message message = Message.class.cast(super.read(element, new Message()));
    return message.muc(new XUser().invite(new Invite().reason(super.toString(element, Dictionary.FIELD_REASON)).continued(super.toString(element, Dictionary.FIELD_CONTINUE)).setFrom(element.get(Dictionary.FIELD_INVITE).toString()))).delay(super.delay(element, message)).request(Boolean.valueOf(element.get(Dictionary.FIELD_ACK).toString()));
  }
View Full Code Here

    this.room = room;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Invite invite = protocol.cast(Message.class).getMuc().password(this.room.build(super.build(protocol.parent().getTo())).pull(Dictionary.FIELD_PASSWORD, String.class)).getInvite();
    super.findOne(super.build(invite.getTo()), true).write(this.prepareAndReturn(context, protocol.cast(Message.class), invite).reply());
    return true;
  }
View Full Code Here

  @Override
  public AffiliationBroadcast broadcast(JID group, Room room, MucItem item, JIDContext invoker) {
    // 岗位限制则发出加入邀请
    if (!room.allowed(this.jidBuilder.build(item.getJid()), RoomConfig.AFFILIATIONALLOW)) {
      // Message.to = group, Invite.to = item.jid
      this.proxy.input(invoker, new Message().muc(new XUser().invite(new Invite().setTo(item.getJid()))).setTo(group));
    }
    return this;
  }
View Full Code Here

TOP

Related Classes of com.sissi.protocol.muc.Invite

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.