use of com.fastaccess.data.dao.CommentRequestModel in project FastHub by k0shk0sh.
the class GistCommentsPresenter method onHandleComment.
@Override
public void onHandleComment(@NonNull String text, @Nullable Bundle bundle, String gistId) {
CommentRequestModel model = new CommentRequestModel();
model.setBody(text);
manageDisposable(RxHelper.getObservable(RestProvider.getGistService(isEnterprise()).createGistComment(gistId, model)).doOnSubscribe(disposable -> sendToView(view -> view.showBlockingProgress(0))).subscribe(comment -> sendToView(view -> view.onAddNewComment(comment)), throwable -> {
onError(throwable);
sendToView(GistCommentsMvp.View::hideBlockingProgress);
}));
}
use of com.fastaccess.data.dao.CommentRequestModel in project FastHub by k0shk0sh.
the class IssueTimelinePresenter method onHandleComment.
@Override
public void onHandleComment(@NonNull String text, @Nullable Bundle bundle) {
if (getView() == null)
return;
Issue issue = getView().getIssue();
if (issue != null) {
if (bundle == null) {
CommentRequestModel commentRequestModel = new CommentRequestModel();
commentRequestModel.setBody(text);
manageDisposable(RxHelper.getObservable(RestProvider.getIssueService(isEnterprise()).createIssueComment(issue.getLogin(), issue.getRepoId(), issue.getNumber(), commentRequestModel)).doOnSubscribe(disposable -> sendToView(view -> view.showBlockingProgress(0))).subscribe(comment -> sendToView(view -> view.addNewComment(TimelineModel.constructComment(comment))), throwable -> {
onError(throwable);
sendToView(IssueTimelineMvp.View::onHideBlockingProgress);
}));
}
}
}
Aggregations