[Notice] Announcing the End of Demo Server [Read me]
noti: Add method for getting noti message with Plain format
@46f53807af9ef66cf8fe8f400f14dd1ccbacfec0
--- app/notification/INotificationEvent.java
+++ app/notification/INotificationEvent.java
... | ... | @@ -1,23 +1,9 @@ |
1 | 1 |
/** |
2 |
- * Yobi, Project Hosting SW |
|
3 |
- * |
|
4 |
- * Copyright 2015 NAVER Corp. |
|
5 |
- * http://yobi.io |
|
6 |
- * |
|
7 |
- * @author Yi EungJun |
|
8 |
- * |
|
9 |
- * Licensed under the Apache License, Version 2.0 (the "License"); |
|
10 |
- * you may not use this file except in compliance with the License. |
|
11 |
- * You may obtain a copy of the License at |
|
12 |
- * |
|
13 |
- * http://www.apache.org/licenses/LICENSE-2.0 |
|
14 |
- * |
|
15 |
- * Unless required by applicable law or agreed to in writing, software |
|
16 |
- * distributed under the License is distributed on an "AS IS" BASIS, |
|
17 |
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
18 |
- * See the License for the specific language governing permissions and |
|
19 |
- * limitations under the License. |
|
20 |
- */ |
|
2 |
+ * Yona, 21st Century Project Hosting SW |
|
3 |
+ * <p> |
|
4 |
+ * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp. |
|
5 |
+ * https://yona.io |
|
6 |
+ **/ |
|
21 | 7 |
package notification; |
22 | 8 |
|
23 | 9 |
import models.User; |
... | ... | @@ -36,6 +22,8 @@ |
36 | 22 |
|
37 | 23 |
String getMessage(Lang lang); |
38 | 24 |
|
25 |
+ String getPlainMessage(Lang lang); |
|
26 |
+ |
|
39 | 27 |
String getUrlToView(); |
40 | 28 |
|
41 | 29 |
Date getCreatedDate(); |
--- app/notification/MergedNotificationEvent.java
+++ app/notification/MergedNotificationEvent.java
... | ... | @@ -1,23 +1,9 @@ |
1 | 1 |
/** |
2 |
- * Yobi, Project Hosting SW |
|
3 |
- * |
|
4 |
- * Copyright 2015 NAVER Corp. |
|
5 |
- * http://yobi.io |
|
6 |
- * |
|
7 |
- * @author Yi EungJun |
|
8 |
- * |
|
9 |
- * Licensed under the Apache License, Version 2.0 (the "License"); |
|
10 |
- * you may not use this file except in compliance with the License. |
|
11 |
- * You may obtain a copy of the License at |
|
12 |
- * |
|
13 |
- * http://www.apache.org/licenses/LICENSE-2.0 |
|
14 |
- * |
|
15 |
- * Unless required by applicable law or agreed to in writing, software |
|
16 |
- * distributed under the License is distributed on an "AS IS" BASIS, |
|
17 |
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
18 |
- * See the License for the specific language governing permissions and |
|
19 |
- * limitations under the License. |
|
20 |
- */ |
|
2 |
+ * Yona, 21st Century Project Hosting SW |
|
3 |
+ * <p> |
|
4 |
+ * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp. |
|
5 |
+ * https://yona.io |
|
6 |
+ **/ |
|
21 | 7 |
package notification; |
22 | 8 |
|
23 | 9 |
import com.google.common.base.Joiner; |
... | ... | @@ -65,6 +51,15 @@ |
65 | 51 |
} |
66 | 52 |
|
67 | 53 |
@Override |
54 |
+ public String getPlainMessage(Lang lang) { |
|
55 |
+ List<String> messages = new ArrayList<>(); |
|
56 |
+ for(INotificationEvent event : messageSources) { |
|
57 |
+ messages.add(event.getPlainMessage(lang)); |
|
58 |
+ } |
|
59 |
+ return Joiner.on("\n\n---\n\n").join(messages); |
|
60 |
+ } |
|
61 |
+ |
|
62 |
+ @Override |
|
68 | 63 |
public String getUrlToView() { |
69 | 64 |
return main.getUrlToView(); |
70 | 65 |
} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?