コード例 #1
0
ファイル: ModeHandler.java プロジェクト: ZoogieZork/Yaaic
  /** Execute /mode */
  @Override
  public void execute(String[] params, Server server, Conversation conversation, IRCService service)
      throws CommandException {
    if (params.length > 2) {
      String modes = BaseHandler.mergeParams(params, 2);

      service.getConnection(server.getId()).setMode(params[1], modes);
    } else {
      throw new CommandException(service.getString(R.string.invalid_number_of_params));
    }
  }
コード例 #2
0
ファイル: DevoiceHandler.java プロジェクト: haruyama/Yaaic
  /** Execute /devoice */
  @Override
  public void execute(String[] params, Server server, Conversation conversation, IRCService service)
      throws CommandException {
    if (conversation.getType() != Conversation.TYPE_CHANNEL) {
      throw new CommandException(service.getString(R.string.only_usable_from_channel));
    }

    if (params.length == 2) {
      service.getConnection(server.getId()).deVoice(conversation.getName(), params[1]);
    } else {
      throw new CommandException(service.getString(R.string.invalid_number_of_params));
    }
  }