mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2025-01-01 00:18:58 +00:00
Added comments users ID parsing.
This commit is contained in:
parent
11b10a13ef
commit
8b31b6088c
@ -1,5 +1,7 @@
|
|||||||
package org.communiquons.android.comunic.client.data.posts;
|
package org.communiquons.android.comunic.client.data.posts;
|
||||||
|
|
||||||
|
import org.communiquons.android.comunic.client.data.comments.Comment;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -17,7 +19,7 @@ public class PostsList extends ArrayList<Post> {
|
|||||||
private static final String TAG = "PostsList";
|
private static final String TAG = "PostsList";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the IDs of the users who created the posts
|
* Get the IDs of the users who created the posts and their comments
|
||||||
*
|
*
|
||||||
* @return The list of users of the post
|
* @return The list of users of the post
|
||||||
*/
|
*/
|
||||||
@ -31,6 +33,18 @@ public class PostsList extends ArrayList<Post> {
|
|||||||
//Add User ID if required
|
//Add User ID if required
|
||||||
if(!ids.contains(userID))
|
if(!ids.contains(userID))
|
||||||
ids.add(userID);
|
ids.add(userID);
|
||||||
|
|
||||||
|
if(post.getComments_list() != null){
|
||||||
|
|
||||||
|
//Process the list of comments
|
||||||
|
for(Comment comment : post.getComments_list()){
|
||||||
|
|
||||||
|
if(ids.contains(comment.getUserID()))
|
||||||
|
ids.add(comment.getUserID());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ids;
|
return ids;
|
||||||
|
Loading…
Reference in New Issue
Block a user