Yi EungJun 2015-03-10
Rename Mention.add() to Mention.update()
The method not only adds mentioned users but also removes them.
@08bc8eb41ccb311d697bf168abef744eb665fcf7
app/models/AbstractPosting.java
--- app/models/AbstractPosting.java
+++ app/models/AbstractPosting.java
@@ -252,7 +252,7 @@
 
     protected void updateMention() {
         if (this.body != null) {
-            Mention.add(this.asResource(), NotificationEvent.getMentionedUsers(this.body));
+            Mention.update(this.asResource(), NotificationEvent.getMentionedUsers(this.body));
         }
     }
 
app/models/Comment.java
--- app/models/Comment.java
+++ app/models/Comment.java
@@ -88,7 +88,7 @@
     }
 
     protected void updateMention() {
-        Mention.add(this.asResource(), NotificationEvent.getMentionedUsers(this.contents));
+        Mention.update(this.asResource(), NotificationEvent.getMentionedUsers(this.contents));
     }
 
     public void delete() {
app/models/Mention.java
--- app/models/Mention.java
+++ app/models/Mention.java
@@ -55,7 +55,7 @@
      * @param resource the resource mentioning the users
      * @param mentionedUsers the users mentioned by the resource
      */
-    public static void add(Resource resource, Set<User> mentionedUsers) {
+    public static void update(Resource resource, Set<User> mentionedUsers) {
         for (Mention mention : find.where().eq("resourceType", resource.getType()).eq("resourceId",
                 resource.getId()).findList()) {
             if (mentionedUsers.contains(mention.user)) {
Add a comment
List