diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PageType.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PageType.java index dde69a0..41b618a 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PageType.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PageType.java @@ -12,6 +12,11 @@ public enum PageType { /** * User page */ - USER_PAGE + USER_PAGE, + + /** + * Group page + */ + GROUP_PAGE } diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/PostsHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/PostsHelper.java index 5cd7149..31bd23b 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/PostsHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/PostsHelper.java @@ -315,6 +315,12 @@ public class PostsHelper { 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.setComments_list(CommentsHelper.parse_json_array(json.getJSONArray("comments")));