Mijeong Park Mijeong Park 2018-01-31
noti: Add method for getting noti message with Plain format
@46f53807af9ef66cf8fe8f400f14dd1ccbacfec0
app/notification/INotificationEvent.java
--- app/notification/INotificationEvent.java
+++ app/notification/INotificationEvent.java
@@ -1,23 +1,9 @@
 /**
- * Yobi, Project Hosting SW
- *
- * Copyright 2015 NAVER Corp.
- * http://yobi.io
- *
- * @author Yi EungJun
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Yona, 21st Century Project Hosting SW
+ * <p>
+ * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp.
+ * https://yona.io
+ **/
 package notification;
 
 import models.User;
@@ -36,6 +22,8 @@
 
     String getMessage(Lang lang);
 
+    String getPlainMessage(Lang lang);
+
     String getUrlToView();
 
     Date getCreatedDate();
app/notification/MergedNotificationEvent.java
--- app/notification/MergedNotificationEvent.java
+++ app/notification/MergedNotificationEvent.java
@@ -1,23 +1,9 @@
 /**
- * Yobi, Project Hosting SW
- *
- * Copyright 2015 NAVER Corp.
- * http://yobi.io
- *
- * @author Yi EungJun
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * Yona, 21st Century Project Hosting SW
+ * <p>
+ * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp.
+ * https://yona.io
+ **/
 package notification;
 
 import com.google.common.base.Joiner;
@@ -65,6 +51,15 @@
     }
 
     @Override
+    public String getPlainMessage(Lang lang) {
+        List<String> messages = new ArrayList<>();
+        for(INotificationEvent event : messageSources) {
+            messages.add(event.getPlainMessage(lang));
+        }
+        return Joiner.on("\n\n---\n\n").join(messages);
+    }
+
+    @Override
     public String getUrlToView() {
         return main.getUrlToView();
     }
Add a comment
List