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

@ -11,6 +11,7 @@ import org.wikipedia.dataclient.mwapi.SiteMatrix;
import org.wikipedia.dataclient.mwapi.page.MwMobileViewPageLead;
import org.wikipedia.dataclient.mwapi.page.MwMobileViewPageRemaining;
import org.wikipedia.dataclient.mwapi.page.MwQueryPageSummary;
import org.wikipedia.dataclient.mwapi.page.MwThankPostResponse;
import org.wikipedia.edit.Edit;
import org.wikipedia.edit.preview.EditPreview;
import org.wikipedia.login.LoginClient;
@ -192,7 +193,7 @@ public interface Service {
@FormUrlEncoded
@POST(MW_API_PREFIX + "action=thank")
@NonNull Observable<MwPostResponse> thank(@Nullable @Field("rev") String rev,
@NonNull Observable<MwThankPostResponse> thank(@Nullable @Field("rev") String rev,
@Nullable @Field("log") String log,
@NonNull @Field("token") String token,
@Nullable @Field("source") String source);

View file

@ -0,0 +1,38 @@
package org.wikipedia.dataclient.mwapi.page;
import org.wikipedia.dataclient.mwapi.MwResponse;
public class MwThankPostResponse extends MwResponse {
private Result result;
public Result getResult() {
return result;
}
public void setResult(Result result) {
this.result = result;
}
public class Result {
private Integer success;
private String recipient;
public Integer getSuccess() {
return success;
}
public void setSuccess(Integer success) {
this.success = success;
}
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
}
}