Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Force the new captcha when making threads.
Browse files Browse the repository at this point in the history
Closes #291
  • Loading branch information
floens committed Mar 19, 2017
1 parent ccb343c commit 550abae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ private void switchPage(Page page, boolean animate) {
callback.setPage(Page.INPUT, animate);
break;
case CAPTCHA:
callback.setCaptchaVersion(ChanSettings.postNewCaptcha.get() || loadable.isCatalogMode());
callback.setPage(Page.CAPTCHA, true);

if (!captchaInited) {
Expand Down Expand Up @@ -411,6 +412,8 @@ public interface ReplyPresenterCallback {

void setPage(Page page, boolean animate);

void setCaptchaVersion(boolean newCaptcha);

void initCaptcha(String baseUrl, String siteKey, CaptchaCallback callback);

void resetCaptcha();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public String getName() {

postDefaultName = new StringSetting(p, "preference_default_name", "");
postPinThread = new BooleanSetting(p, "preference_pin_on_post", false);
postNewCaptcha = new BooleanSetting(p, "preference_new_captcha", false);
postNewCaptcha = new BooleanSetting(p, "preference_new_captcha", true);

developer = new BooleanSetting(p, "preference_developer", false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.floens.chan.core.model.Loadable;
import org.floens.chan.core.model.Reply;
import org.floens.chan.core.presenter.ReplyPresenter;
import org.floens.chan.core.settings.ChanSettings;
import org.floens.chan.ui.activity.StartActivity;
import org.floens.chan.ui.drawable.DropdownArrowDrawable;
import org.floens.chan.ui.helper.HintPopup;
Expand All @@ -62,7 +61,7 @@
public class ReplyLayout extends LoadView implements View.OnClickListener, AnimationUtils.LayoutAnimationProgress, ReplyPresenter.ReplyPresenterCallback, TextWatcher, ImageDecoder.ImageDecoderCallback, SelectionListeningEditText.SelectionChangedListener {
private ReplyPresenter presenter;
private ReplyLayoutCallback callback;
private boolean newCaptcha = ChanSettings.postNewCaptcha.get();
private boolean newCaptcha;

private View replyInputLayout;
private FrameLayout captchaContainer;
Expand Down Expand Up @@ -248,6 +247,11 @@ public void setPage(ReplyPresenter.Page page, boolean animate) {
}
}

@Override
public void setCaptchaVersion(boolean newCaptcha) {
this.newCaptcha = newCaptcha;
}

@Override
public void initCaptcha(String baseUrl, String siteKey, CaptchaCallback callback) {
captchaLayout.initCaptcha(baseUrl, siteKey, ThemeHelper.getInstance().getTheme().isLightTheme, callback);
Expand Down
2 changes: 1 addition & 1 deletion Clover/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ Re-enable this permission in the app settings if you permanently disabled it."</
<string name="setting_save_folder_error_create_folder">Error creating save folder</string>
<string name="setting_folder_pick_ok">Choose</string>
<string name="setting_use_new_captcha">Use the new captcha</string>
<string name="setting_use_new_captcha_description">Enable to use the newer recaptcha.</string>
<string name="setting_use_new_captcha_description">Enable to use the newer recaptcha for thread replies.</string>
<string name="setting_save_original_filename">Save original filename</string>
<string name="setting_save_board_folder">Save images in a board folder</string>
<string name="setting_save_board_folder_description">Create a folder for each board to store images in</string>
Expand Down

0 comments on commit 550abae

Please sign in to comment.