if(Content.ContentType.PHOTO == sharedContent.type) {
ContentTag contentTag = new ContentTag(sharedContent.id, Content.ContentType.PHOTO, sharedTag);
contentTag.save();
}
}
Notification notification = new Notification();
if(from.basic_information != null) {
StringBuffer textSb = new StringBuffer();
textSb.append(from.basic_information.firstName).append(" ").
append(from.basic_information.lastName).append(" te ha enviado un mensaje.");
if(sharedContents.size() > 0) {
textSb.append(" Tiene ").append(sharedContents.size()).append(" contenidos.");
}
notification.message = textSb.toString();
} else {
notification.message = "El administrador ha compartido contigo "
+ sharedContents.size() + " contenidos.";
}
notification.owner = receiver;
notification.type = Notification.NotificationType.INBOX;
notification.insert();
// Creating a task for send an email with the notification.
Queue queue = QueueFactory.getDefaultQueue();
String residenceDomain = null;
String username = Session.current().get(SessionConstants.USER);