Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void) alreadyAcceptedFriend:(VAPNotification*)notification completion:(void (^)(BOOL success))completionBlock {
- self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
- self.hud.labelText = @"Loading...";
- self.hud.detailsLabelColor = [UIColor lightGrayColor];
- self.hud.color = VAPPY_PURPLE;
- [[ServerAPI sharedClient] getAllFriends:^(NSArray *info) {
- BOOL hasAccepted=YES;
- for (NSDictionary* friend in info) {
- if([friend hasKey:@"id"]){
- NSNumber* fRId=friend[@"id"];
- NSNumber* notFRId = notification.raw[@"friend_request_id"];
- if ([fRId isEqual:notFRId]) {
- hasAccepted=NO;
- }
- }
- }
- completionBlock(hasAccepted);
- } andErrorBlock:^(NSError *error, AFHTTPRequestOperation *operation) {
- [self.hud hide:YES];
- completionBlock(FALSE);
- }];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement