mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-12-25 13:08:58 +00:00
Notifications service get pending calls
This commit is contained in:
parent
aba9a500dc
commit
b1170d9075
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user