/** * Determines if it is needed to send notification to the user * * @param mentionedUser this user was mentioned * @return true if we need to send notification and false otherwise */ private boolean shouldNotificationBeSent(JCUser mentionedUser) { boolean isOtherNotificationAlreadySent = post.getSubscribers().contains(mentionedUser); return !isOtherNotificationAlreadySent && mentionedUser.isMentioningNotificationsEnabled(); }
/** * Constructor which fills dto fields from user. * * @param user copying source */ public UserNotificationsDto(JCUser user) { this.userId = user.getId(); this.autosubscribe = user.isAutosubscribe(); this.mentioningNotificationsEnabled = user.isMentioningNotificationsEnabled(); this.sendPmNotification = user.isSendPmNotification(); }
copy.setEnabled(user.isEnabled()); copy.setAutosubscribe(user.isAutosubscribe()); copy.setMentioningNotificationsEnabled(user.isMentioningNotificationsEnabled()); copy.setSendPmNotification(user.isSendPmNotification()); copy.setAvatarLastModificationTime(user.getAvatarLastModificationTime());