Skip to content

Commit 3503ff6

Browse files
committed
Additional methods for issue comment
1 parent 192e21a commit 3503ff6

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package org.kohsuke.github;
2+
3+
/**
4+
* How is an user associated with a repository?
5+
*
6+
* @author Kohsuke Kawaguchi
7+
*/
8+
public enum GHCommentAuthorAssociation {
9+
/**
10+
* Author has been invited to collaborate on the repository.
11+
*/
12+
COLLABORATOR,
13+
/**
14+
* Author has previously committed to the repository.
15+
*/
16+
CONTRIBUTOR,
17+
/**
18+
* Author has not previously committed to GitHub.
19+
*/
20+
FIRST_TIMER,
21+
/**
22+
* Author has not previously committed to the repository.
23+
*/
24+
FIRST_TIME_CONTRIBUTOR,
25+
/**
26+
* Author is a member of the organization that owns the repository.
27+
*/
28+
MEMBER,
29+
/**
30+
* Author has no association with the repository.
31+
*/
32+
NONE,
33+
/**
34+
* Author is the owner of the repository.
35+
*/
36+
OWNER
37+
}

src/main/java/org/kohsuke/github/GHIssueComment.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
public class GHIssueComment extends GHObject implements Reactable {
3737
GHIssue owner;
3838

39-
private String body, gravatar_id;
39+
private String body, gravatar_id, html_url, author_association;
4040
private GHUser user; // not fully populated. beware.
4141

4242
/*package*/ GHIssueComment wrapUp(GHIssue owner) {
@@ -73,12 +73,13 @@ public GHUser getUser() throws IOException {
7373
return owner == null || owner.root.isOffline() ? user : owner.root.getUser(user.getLogin());
7474
}
7575

76-
/**
77-
* @deprecated This object has no HTML URL.
78-
*/
7976
@Override
8077
public URL getHtmlUrl() {
81-
return null;
78+
return GitHub.parseURL(html_url);
79+
}
80+
81+
public GHCommentAuthorAssociation getAuthorAssociation() {
82+
return GHCommentAuthorAssociation.valueOf(author_association);
8283
}
8384

8485
/**

0 commit comments

Comments
 (0)