aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-12 11:45:04 (EDT)
committerChris Aniszczyk2011-04-12 14:15:06 (EDT)
commitdd2d9f5f086ccdf96138f357e70e7cdac8303156 (patch)
treed972d82a2db4d65da8917aa8b366f25f1a61e47d
parentffacd2c4a10a0afcb280f3ed0d249fdb28aa686a (diff)
downloadegit-github-dd2d9f5f086ccdf96138f357e70e7cdac8303156.zip
egit-github-dd2d9f5f086ccdf96138f357e70e7cdac8303156.tar.gz
egit-github-dd2d9f5f086ccdf96138f357e70e7cdac8303156.tar.bz2
Add gravatar url for assignee and reporter as task attributesrefs/changes/70/3070/2
Change-Id: Ic546adcd0d6a762fdee615f17fec4234d85ebd43 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubTaskDataHandler.java19
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/IssueSummaryPart.java2
2 files changed, 17 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubTaskDataHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubTaskDataHandler.java
index f969052..9e478ab 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubTaskDataHandler.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubTaskDataHandler.java
@@ -75,10 +75,23 @@ public class GitHubTaskDataHandler extends AbstractTaskDataHandler {
issue.getUpdatedAt());
createAttribute(data, GitHubTaskAttributes.CLOSED_DATE,
issue.getClosedAt());
- createAttribute(data, GitHubTaskAttributes.REPORTER, issue.getUser(),
+
+ User reporter = issue.getUser();
+ createAttribute(data, GitHubTaskAttributes.REPORTER, reporter,
+ repository);
+ String reporterGravatar = reporter != null ? reporter.getGravatarUrl()
+ : null;
+ createAttribute(data, GitHubTaskAttributes.REPORTER_GRAVATAR,
+ reporterGravatar);
+
+ User assignee = issue.getAssignee();
+ createAttribute(data, GitHubTaskAttributes.ASSIGNEE, assignee,
repository);
- createAttribute(data, GitHubTaskAttributes.ASSIGNEE,
- issue.getAssignee(), repository);
+ String assigneeGravatar = assignee != null ? assignee.getGravatarUrl()
+ : null;
+ createAttribute(data, GitHubTaskAttributes.ASSIGNEE_GRAVATAR,
+ assigneeGravatar);
+
createAttribute(data, GitHubTaskAttributes.COMMENT_NEW, "");
createAttribute(data, GitHubTaskAttributes.LABELS, issue.getLabels());
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/IssueSummaryPart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/IssueSummaryPart.java
index f3bfa53..9a0ca9d 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/IssueSummaryPart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/IssueSummaryPart.java
@@ -127,7 +127,7 @@ public class IssueSummaryPart extends AbstractTaskEditorPart {
private boolean addAvatarPart(Composite parent, FormToolkit toolkit,
TaskAttribute avatarAttribute, IRepositoryPerson person) {
- if (avatarAttribute == null)
+ if (avatarAttribute == null || avatarAttribute.getValue().length() == 0)
return false;
AvatarLabel label = new AvatarLabel(GitHubUi.getDefault().getStore(),