Parse group metadata associated with posts.

This commit is contained in:
Pierre HUBERT 2018-08-06 11:29:29 +02:00
parent fb4b46074a
commit 9c39112bf7
2 changed files with 12 additions and 1 deletions

View File

@ -12,6 +12,11 @@ public enum PageType {
/** /**
* User page * User page
*/ */
USER_PAGE USER_PAGE,
/**
* Group page
*/
GROUP_PAGE
} }

View File

@ -315,6 +315,12 @@ public class PostsHelper {
post.setPage_id(json.getInt("user_page_id")); post.setPage_id(json.getInt("user_page_id"));
} }
else if(json.getInt("group_id") != 0){
//Set information about the user
post.setPage_type(PageType.GROUP_PAGE);
post.setPage_id(json.getInt("group_id"));
}
post.setContent(json.getString("content")); post.setContent(json.getString("content"));
post.setComments_list(CommentsHelper.parse_json_array(json.getJSONArray("comments"))); post.setComments_list(CommentsHelper.parse_json_array(json.getJSONArray("comments")));