diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/NotificationsHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/NotificationsHelper.java index fece44d..f4a7dd0 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/NotificationsHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/NotificationsHelper.java @@ -53,6 +53,7 @@ public class NotificationsHelper { APIRequest params = new APIRequest(mContext, "notifications/count_all_news"); params.addBoolean("friends_request", true); + params.addBoolean("include_calls", true); //Try to perform the request and parse results try { @@ -65,6 +66,7 @@ public class NotificationsHelper { res.setNotificationsCount(object.getInt("notifications")); res.setConversationsCount(object.getInt("conversations")); res.setFriendsRequestsCount(object.getInt("friends_request")); + res.setPendingCalls(object.getInt("calls")); return res; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/models/NotificationsCount.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/NotificationsCount.java index 609ed71..f57dac7 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/models/NotificationsCount.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/NotificationsCount.java @@ -13,6 +13,7 @@ public class NotificationsCount { private int notificationsCount; private int conversationsCount; private int friendsRequestsCount; + private int pendingCalls; //Set and get notifications count @@ -42,4 +43,16 @@ public class NotificationsCount { public void setFriendsRequestsCount(int friendsRequestsCount) { this.friendsRequestsCount = friendsRequestsCount; } + + public int getPendingCalls() { + return pendingCalls; + } + + public boolean hasPendingCalls() { + return pendingCalls > 0; + } + + public void setPendingCalls(int pendingCalls) { + this.pendingCalls = pendingCalls; + } }