mirror of
				https://github.com/pierre42100/ComunicAndroid
				synced 2025-11-04 11:34:06 +00:00 
			
		
		
		
	Notifications service get pending calls
This commit is contained in:
		@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user