Compatible with social model 2.0.0

This commit is contained in:
Ahmed Salah Tawfik Ibrahim 2024-01-19 11:05:56 +01:00
parent cd5497507d
commit 3f7a9ae8a0
1 changed files with 13 additions and 8 deletions

View File

@ -34,7 +34,6 @@ public class CommentNotificationsThread implements Runnable {
/**
*
* @param libclient
* @param userManager
* @param commenterUserId
* @param commentedPostId
@ -44,7 +43,7 @@ public class CommentNotificationsThread implements Runnable {
* @param commentKey
* @param likes
*/
public CommentNotificationsThread(LibClient libclient, UserManager userManager, String commenterUserId,
public CommentNotificationsThread(UserManager userManager, String commenterUserId,
String commentedPostId, String commentText, NotificationsManager nm, String postOwnerId, String commentKey, ArrayList<Like> likes) {
super();
this.nm = nm;
@ -55,15 +54,21 @@ public class CommentNotificationsThread implements Runnable {
this.commentKey = commentKey;
this.likes = likes;
this.userManager = userManager;
userIdsToNotify = new HashSet<String>();
List<Comment> postComments = libclient.getAllCommentsByPostIdLib(commentedPostId);
for (Comment comment : postComments) {
if (comment.getUserid().compareTo(commenterUserId) != 0) {
userIdsToNotify.add(comment.getUserid());
try {
LibClient libClient = new LibClient();
userIdsToNotify = new HashSet<String>();
List<Comment> postComments = libClient.getAllCommentsByPostIdLib(commentedPostId);
for (Comment comment : postComments) {
if (comment.getUserid().compareTo(commenterUserId) != 0) {
userIdsToNotify.add(comment.getUserid());
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
//clean
//this.comments = comments;
}