revisited notification subjects
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@94328 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3042d6828f
commit
1e4fa4fb35
|
@ -453,8 +453,8 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean notifyCommentReply(String userIdToNotify, String feedid, String commentText, String feedOwnerFullName) {
|
||||
String notificationText = (aslSession.getUserFullName().compareTo(feedOwnerFullName) == 0) ?
|
||||
public boolean notifyCommentReply(String userIdToNotify, String feedid, String commentText, String feedOwnerFullName, String feedOwnerId) {
|
||||
String notificationText = (aslSession.getUsername().compareTo(feedOwnerId) == 0) ?
|
||||
"also commented on his post: " + escapeHtml(commentText)
|
||||
:
|
||||
"also commented on " + feedOwnerFullName + "'s post: " + escapeHtml(commentText);
|
||||
|
@ -522,7 +522,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
feedid, //the post
|
||||
new Date(),
|
||||
"/group/data-e-infrastructure-gateway?oid="+feedid,
|
||||
"likes your post: " + escapeHtml(feedText),
|
||||
"favorited your post: " + escapeHtml(feedText),
|
||||
false,
|
||||
aslSession.getUsername(),
|
||||
aslSession.getUserFullName(),
|
||||
|
|
|
@ -163,7 +163,7 @@ public interface NotificationsManager {
|
|||
* @param feedOwnerFullName the full name of the user who created this post
|
||||
* @return true if the notification is correctly delivered, false otherwise
|
||||
*/
|
||||
boolean notifyCommentReply(String userIdToNotify, String feedid, String feedText, String feedOwnerFullName);
|
||||
boolean notifyCommentReply(String userIdToNotify, String feedid, String feedText, String feedOwnerFullName, String feedOwnerId);
|
||||
/**
|
||||
* use to notify a user that someone commented on one of his favorite posts
|
||||
*
|
||||
|
|
|
@ -107,7 +107,7 @@ public class EmailPlugin {
|
|||
Address address = new InternetAddress(email);
|
||||
mimeMessage.addRecipient(Message.RecipientType.TO, address);
|
||||
|
||||
mimeMessage.setSubject(getSubjectByNotificationType(notification2Save, portalUrl, vreName));
|
||||
mimeMessage.setSubject(getSubjectByNotificationType(notification2Save, portalUrl, vreName, user.getFirstName()));
|
||||
mimeMessage.setContent(getHTMLEmail(notification2Save, user.getFirstName(), portalUrl, email), "text/html; charset=UTF-8");
|
||||
mimeMessage.setSentDate(new Date());
|
||||
Transport.send(mimeMessage);
|
||||
|
@ -124,14 +124,14 @@ public class EmailPlugin {
|
|||
* @param vreName
|
||||
* @return
|
||||
*/
|
||||
private static String getSubjectByNotificationType(Notification notification2Save, String portalURL, String vreName) {
|
||||
private static String getSubjectByNotificationType(Notification notification2Save, String portalURL, String vreName, String userFirstName) {
|
||||
switch (notification2Save.getType()) {
|
||||
case LIKE:
|
||||
return "Like on your post";
|
||||
return notification2Save.getSenderFullName()+" favorited your post";
|
||||
case COMMENT:
|
||||
return "Reply on a post";
|
||||
return notification2Save.getSenderFullName()+" commented on the post";
|
||||
case MESSAGE:
|
||||
return "New message";
|
||||
return notification2Save.getSenderFullName()+ " sent you a message";
|
||||
case WP_FOLDER_ADDEDUSER:
|
||||
return "New user in a shared folder";
|
||||
case WP_FOLDER_REMOVEDUSER:
|
||||
|
@ -145,11 +145,11 @@ public class EmailPlugin {
|
|||
case WP_ITEM_UPDATED:
|
||||
return "Updated item in a shared folder";
|
||||
case OWN_COMMENT:
|
||||
return "Reply on your post";
|
||||
return notification2Save.getSenderFullName() + " commented on your post";
|
||||
case MENTION:
|
||||
return "Mention in a post";
|
||||
return notification2Save.getSenderFullName() + " mentioned you";
|
||||
case POST_ALERT:
|
||||
return "Important post shared";
|
||||
return notification2Save.getSenderFullName() + " shared an important news on " + vreName;
|
||||
case REQUEST_CONNECTION:
|
||||
return "Connection request";
|
||||
case JOB_COMPLETED_NOK:
|
||||
|
|
Loading…
Reference in New Issue