use of com.meisolsson.githubsdk.model.IssueEvent in project PocketHub by pockethub.
the class RefreshIssueTask method subscribe.
@Override
public void subscribe(ObservableEmitter<FullIssue> emitter) throws Exception {
try {
Issue issue = store.refreshIssue(repo, issueNumber);
if (issue.pullRequest() != null) {
PullRequest pull = getPullRequest(repo.owner().login(), repo.name(), issueNumber);
issue = issue.toBuilder().pullRequest(pull).build();
}
bodyImageGetter.encode(issue.id(), issue.bodyHtml());
List<GitHubComment> comments;
if (issue.comments() > 0) {
comments = getAllComments(repo.owner().login(), repo.name(), issueNumber);
} else {
comments = Collections.emptyList();
}
for (GitHubComment comment : comments) {
commentImageGetter.encode(comment.id(), comment.bodyHtml());
}
List<IssueEvent> events = getAllEvents(repo.owner().login(), repo.name(), issueNumber);
emitter.onNext(new FullIssue(issue, comments, events));
} catch (IOException e) {
emitter.onError(e);
}
}
Aggregations