Notifications service get pending calls

This commit is contained in:
Pierre HUBERT 2019-02-16 17:08:05 +01:00
parent aba9a500dc
commit b1170d9075
2 changed files with 15 additions and 0 deletions

View File

@ -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;

View File

@ -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;
}
}