コード例 #1
0
 @Override
 public Boolean input(JIDContext context, Protocol protocol) {
   JID master = super.jidBuilder.build(protocol.getTo()).getBare();
   super.presenceQueue.offer(
       master,
       context.getJid().getBare(),
       master,
       context.getPresence().setTypeText(Presence.Type.ONLINE.toString()));
   return true;
 }
コード例 #2
0
 @Override
 public boolean input(JIDContext context, Protocol protocol) {
   XData data = protocol.cast(Message.class).getData();
   JID group = super.build(protocol.parent().getTo());
   JID to =
       super.build(data.findField(MucApplyContext.MUC_JID, XField.class).getValue().toString());
   this.mucRoleBuilder
       .build(data.findField(MucApplyContext.MUC_ROLE, XField.class).getValue().toString())
       .change(group.resource(super.ourRelation(to, group).name()));
   return this.proxy.input(
       super.findOne(to, true),
       new Presence()
           .add(this.muc)
           .setTo(
               group.resource(
                   data.findField(MucApplyContext.MUC_NICKNAME, XField.class)
                       .getValue()
                       .toString())));
 }
コード例 #3
0
 @Override
 public boolean input(JIDContext context, Protocol protocol) {
   context.write(
       protocol
           .cast(Bytestreams.class)
           .setStreamhostUsed(this.streamhostUsed)
           .parent()
           .reply()
           .setType(ProtocolType.RESULT));
   return true;
 }
コード例 #4
0
 /**
  * {"pid":Xxx},{"$set":{"ack":false}}
  *
  * @param context
  * @param protocol
  * @return
  */
 private boolean writeAndReturn(JIDContext context, Protocol protocol) {
   this.persistent.peek(
       MongoUtils.asMap(
           BasicDBObjectBuilder.start(
                   Dictionary.FIELD_PID, protocol.cast(Message.class).getReceived().id())
               .get()),
       MongoUtils.asMap(
           BasicDBObjectBuilder.start(
                   "$set", BasicDBObjectBuilder.start(Dictionary.FIELD_ACK, false).get())
               .get()));
   return false;
 }
コード例 #5
0
ファイル: IQActionMatcher.java プロジェクト: rockiee281/sissi
 @Override
 public boolean match(Protocol protocol) {
   return super.match(protocol) && protocol.parent().type(this.type);
 }
コード例 #6
0
 /*
  * 如果为ACK请求
  *
  * @see com.sissi.pipeline.Input#input(com.sissi.context.JIDContext, com.sissi.protocol.Protocol)
  */
 @Override
 public boolean input(JIDContext context, Protocol protocol) {
   return protocol.cast(Message.class).received() ? this.writeAndReturn(context, protocol) : true;
 }
コード例 #7
0
 @Override
 public boolean input(JIDContext context, Protocol protocol) {
   return context.auth() ? this.writeFeature(protocol.cast(Stream.class)) : true;
 }
コード例 #8
0
 @Override
 public boolean input(JIDContext context, Protocol protocol) {
   super.priority(context.priority(protocol.cast(Presence.class).priority(-1)));
   return true;
 }