Package io.meeds.chat.service
Class ChatNotificationService
java.lang.Object
io.meeds.chat.service.ChatNotificationService
This service creates and manages all different notifications related to the chat application
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateMentionNotification(String eventId, String roomId, String userName, String pushKey) Creates a web/Mail notification for mentions in space Chat roomsio.meeds.pwa.model.PwaNotificationMessagecreateNotification(MatrixMessage message, String userName) Creates a notification based on the received messageio.meeds.pwa.model.PwaNotificationMessagecreateNotification(String eventId, String roomId, String userName, long lastMessageTimeStamp, String token) Creates a PWA notification based on the event detailsbooleanisPrivateRoomMutedForUser(String userName, String roomId) booleanisPushNotificationsEnabled(String userName) Check the status of the Push notifications on Chat for a specified uservoidsendCreateNotificationAction(String eventId, String userName, String roomId, int unreadCount) Sends a notification Creation request to the Push service on the browser based on the event contentsvoidtoggleMutePrivateRoom(String userName, String roomId) voidupdatePushNotificationSettings(String userName, boolean pushNotificationStatus) Set the status of the Push notifications on Chat for a specified user
-
Field Details
-
IN_KEY
-
USER_CHAT_NOTIFICATION_SCOPE
public static final org.exoplatform.commons.api.settings.data.Scope USER_CHAT_NOTIFICATION_SCOPE -
MUTED_ROOMS
- See Also:
-
PUSH_NOTIFICATIONS_SETTINGS
- See Also:
-
-
Constructor Details
-
ChatNotificationService
public ChatNotificationService()
-
-
Method Details
-
sendCreateNotificationAction
public void sendCreateNotificationAction(String eventId, String userName, String roomId, int unreadCount) Sends a notification Creation request to the Push service on the browser based on the event contents- Parameters:
eventId- the event IDuserName- the user nameroomId- the room IDunreadCount- the number of unread messages
-
createNotification
public io.meeds.pwa.model.PwaNotificationMessage createNotification(MatrixMessage message, String userName) Creates a notification based on the received message- Parameters:
message- the received messageuserName- the user who will receive the notification- Returns:
- a PWA push notification object
-
createNotification
public io.meeds.pwa.model.PwaNotificationMessage createNotification(String eventId, String roomId, String userName, long lastMessageTimeStamp, String token) Creates a PWA notification based on the event details- Parameters:
eventId- the event IdroomId- the room IDuserName- the user who received the notificationlastMessageTimeStamp- the timestamp of the last messagetoken- the authorization token- Returns:
- notification object
-
createMentionNotification
public boolean createMentionNotification(String eventId, String roomId, String userName, String pushKey) Creates a web/Mail notification for mentions in space Chat rooms- Parameters:
eventId- the event IDroomId- the room IDuserName- the username of the receiver of the notificationpushKey- jwt token of one of the users in case the room is private- Returns:
- true if the Mention notification is created, false otherwise
-
isPrivateRoomMutedForUser
-
toggleMutePrivateRoom
-
isPushNotificationsEnabled
Check the status of the Push notifications on Chat for a specified user- Parameters:
userName- the specified username- Returns:
- true if the Push notifications settings is enabled
-
updatePushNotificationSettings
Set the status of the Push notifications on Chat for a specified user- Parameters:
userName- the specified userpushNotificationStatus- the status true or false
-