Skip to content

Commit

Permalink
Merge branch 'fix/for-v1.9.1' into next
Browse files Browse the repository at this point in the history
Reviewed-by: Mijeong Park
  • Loading branch information
mjpark03 committed Mar 22, 2018
2 parents 445f7d3 + 5475364 commit 67d6c17
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
25 changes: 21 additions & 4 deletions app/models/NotificationEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -978,11 +978,28 @@ private static Set<User> getMandatoryReceivers(Issue issue, EventType eventType)

receivers.removeAll(findUnwatchers(issue.asResource()));
receivers.removeAll(findEventUnwatchersByEventType(issue.project.id, eventType));
receivers.remove(UserApp.currentUser());
receivers.remove(findCurrentUserToBeExcluded(issue.authorId));

return receivers;
}

private static User findCurrentUserToBeExcluded(Long authorId) {
User currentUser;
try {
currentUser = UserApp.currentUser();
} catch (RuntimeException re) {
// expectation: "There is no HTTP Context available from here" runtime exception
currentUser = User.anonymous;
}

if (currentUser.isAnonymous()) {
// It is assumed that it is called by author and processed by system.
return User.find.byId(authorId);
} else {
return currentUser;
}
}

private static Set<User> getMandatoryReceivers(Posting posting, EventType eventType) {
Set<User> receivers = findWatchers(posting.asResource());
receivers.add(posting.getAuthor());
Expand All @@ -991,7 +1008,7 @@ private static Set<User> getMandatoryReceivers(Posting posting, EventType eventT

receivers.removeAll(findUnwatchers(posting.asResource()));
receivers.removeAll(findEventUnwatchersByEventType(posting.project.id, eventType));
receivers.remove(UserApp.currentUser());
receivers.remove(findCurrentUserToBeExcluded(posting.authorId));

return receivers;
}
Expand All @@ -1006,7 +1023,7 @@ private static Set<User> getMandatoryReceivers(Comment comment, EventType eventT

receivers.removeAll(findUnwatchers(parent.asResource()));
receivers.removeAll(findEventUnwatchersByEventType(comment.projectId, eventType));
receivers.remove(UserApp.currentUser());
receivers.remove(findCurrentUserToBeExcluded(comment.authorId));

return receivers;
}
Expand Down Expand Up @@ -1042,7 +1059,7 @@ private static Set<User> extractMembers(Project project) {
private static Set<User> getReceiversForIssueBodyChanged(String oldBody, Issue issue) {
Set<User> receivers = getMandatoryReceivers(issue, ISSUE_BODY_CHANGED);
receivers.addAll(getNewMentionedUsers(oldBody, issue.body));
receivers.remove(UserApp.currentUser());
receivers.remove(findCurrentUserToBeExcluded(issue.authorId));
return receivers;
}

Expand Down
2 changes: 1 addition & 1 deletion app/models/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public Set<User> findAuthorsAndWatchers() {
}

private Set<User> getIssueUsers() {
String issueSql = "SELECT distinct author_id id FROM ISSUE where project_id=" + this.id;
String issueSql = "select distinct author_id id from issue where project_id=" + this.id;
return User.find.setRawSql(RawSqlBuilder.parse(issueSql).create()).findSet();
}

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import java.nio.file.Paths

name := """yona"""

version := "1.9.0"
version := "1.9.1"

libraryDependencies ++= Seq(
// Add your project dependencies here,
Expand Down
3 changes: 3 additions & 0 deletions public/javascripts/lib/atjs/jquery.atwho.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@
};

App.prototype.dispatch = function(e) {
if (e === undefined) {
return;
}
var _, c, ref, results;
ref = this.controllers;
results = [];
Expand Down

0 comments on commit 67d6c17

Please sign in to comment.