Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/org/wikipedia/captcha/CaptchaHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class CaptchaHandler(private val activity: AppCompatActivity, private val wiki:
return captchaResult?.captchaId
}

fun captchaWord(): String {
return binding.captchaText.editText?.text.toString()
fun captchaWord(): String? {
return if (isActive) binding.captchaText.editText?.text.toString() else null
}

fun dispose() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ class CreateAccountActivity : BaseActivity() {
val repeat = getText(binding.createAccountPasswordRepeat)
disposables.add(ServiceFactory.get(wiki).postCreateAccount(getText(binding.createAccountUsername), password, repeat, token, Service.WIKIPEDIA_URL,
email,
if (captchaHandler.isActive) captchaHandler.captchaId() else "null",
if (captchaHandler.isActive) captchaHandler.captchaWord() else "null")
captchaHandler.captchaId().toString(),
captchaHandler.captchaWord().toString())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,9 @@ class DescriptionEditFragment : Fragment() {
ServiceFactory.get(wikiSite).postEditSubmit(pageTitle.prefixedText, "0", null,
editSummary,
AccountUtil.assertUser, text, null, baseRevId, editToken,
if (captchaHandler.isActive) captchaHandler.captchaId() else null,
if (captchaHandler.isActive) captchaHandler.captchaWord() else null, tags = getEditTags()
)
.subscribeOn(Schedulers.io())
captchaHandler.captchaId(),
captchaHandler.captchaWord(), tags = getEditTags()
).subscribeOn(Schedulers.io())
}
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ result ->
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/wikipedia/edit/EditSectionActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ class EditSectionActivity : BaseActivity(), ThemeChooserDialog.Callback, EditPre
disposables.add(ServiceFactory.get(pageTitle.wikiSite).postEditSubmit(pageTitle.prefixedText,
if (sectionID >= 0) sectionID.toString() else null, null, summaryText, AccountUtil.assertUser,
binding.editSectionText.text.toString(), null, currentRevision, token,
if (captchaHandler.isActive) captchaHandler.captchaId() else "null",
if (captchaHandler.isActive) captchaHandler.captchaWord() else "null",
captchaHandler.captchaId().toString(),
captchaHandler.captchaWord().toString(),
isMinorEdit,
watchThisPage,
tags = getEditTag())
Expand Down