fixes - #3559 - Failed to send thanks" notification, but thank actually sent successfully

I create another Model Class->"MwThankPostResponse.java" to store the Result of Post Request POST(MW_API_PREFIX+"action=thank")
This commit is contained in:
Prince kushwaha 2021-02-08 19:20:30 +05:30 committed by GitHub
parent 8384ad03dc
commit 944bede42d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 2 deletions

View file

@ -27,7 +27,7 @@ class ThanksClient @Inject constructor(
fun thank(revisionId: Long): Observable<Boolean> {
return try {
service.thank(revisionId.toString(), null, csrfTokenClient.tokenBlocking, CommonsApplication.getInstance().userAgent)
.map { mwQueryResponse -> mwQueryResponse.successVal == 1 }
.map { mwThankPostResponse -> mwThankPostResponse.result.success== 1 }
} catch (throwable: Throwable) {
Observable.just(false)
}