forked from mirrors/linphone-iphone
Merge branch 'master' into dev_group_chat
This commit is contained in:
commit
073e5779e5
5 changed files with 9 additions and 29 deletions
|
|
@ -538,7 +538,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
if (!linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
const LinphoneCallParams *param = linphone_call_get_current_params(call);
|
||||
const LinphoneCallAppData *callAppData =
|
||||
(__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call));
|
||||
(__bridge const LinphoneCallAppData *)(linphone_call_get_user_data(call));
|
||||
if (state == LinphoneCallStreamsRunning && callAppData->videoRequested &&
|
||||
linphone_call_params_low_bandwidth_enabled(param)) {
|
||||
// too bad video was not enabled because low bandwidth
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
if (address.length == 0) {
|
||||
LinphoneCallLog *log = linphone_core_get_last_outgoing_call_log(LC);
|
||||
if (log) {
|
||||
LinphoneAddress *to = linphone_call_log_get_to(log);
|
||||
const LinphoneAddress *to = linphone_call_log_get_to_address(log);
|
||||
const char *domain = linphone_address_get_domain(to);
|
||||
char *bis_address = NULL;
|
||||
LinphoneProxyConfig *def_proxy = linphone_core_get_default_proxy_config(LC);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#import "UIVideoButton.h"
|
||||
#include "LinphoneManager.h"
|
||||
#import "Utils.h"
|
||||
#import "Log.h"
|
||||
|
||||
@implementation UIVideoButton {
|
||||
BOOL last_update_state;
|
||||
|
|
@ -42,7 +42,7 @@ INIT_WITH_COMMON_CF {
|
|||
|
||||
LinphoneCall *call = linphone_core_get_current_call(LC);
|
||||
if (call) {
|
||||
LinphoneCallAppData *callAppData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call);
|
||||
LinphoneCallAppData *callAppData = (__bridge LinphoneCallAppData *)linphone_call_get_user_data(call);
|
||||
callAppData->videoRequested =
|
||||
TRUE; /* will be used later to notify user if video was not activated because of the linphone core*/
|
||||
LinphoneCallParams *call_params = linphone_core_create_call_params(LC,call);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <AudioToolbox/AudioServices.h>
|
||||
#import "LinphoneAppDelegate.h"
|
||||
#import "Log.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
static RootViewManager *rootViewManagerInstance = nil;
|
||||
|
|
@ -779,7 +780,7 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
|
||||
LinphoneCall *call = linphone_core_get_current_call(LC);
|
||||
if (call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
LinphoneCallAppData *callData = (__bridge LinphoneCallAppData *)linphone_call_get_user_pointer(call);
|
||||
LinphoneCallAppData *callData = (__bridge LinphoneCallAppData *)linphone_call_get_user_data(call);
|
||||
if (callData != nil) {
|
||||
if (state == UIDeviceBatteryStateUnplugged) {
|
||||
if (level <= 0.2f && !callData->batteryWarningShown) {
|
||||
|
|
|
|||
|
|
@ -123,33 +123,12 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
|
|||
CNEntityType entityType = CNEntityTypeContacts;
|
||||
if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusNotDetermined) {
|
||||
CNContactStore * contactStore = [[CNContactStore alloc] init];
|
||||
LOGD(@"CNContactStore requesting authorization");
|
||||
[contactStore requestAccessForEntityType:entityType completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
||||
if(granted){
|
||||
NSError* contactError;
|
||||
store = [[CNContactStore alloc]init];
|
||||
[store containersMatchingPredicate:[CNContainer predicateForContainersWithIdentifiers: @[store.defaultContainerIdentifier]] error:&contactError];
|
||||
NSArray * keysToFetch =@[CNContactEmailAddressesKey, CNContactPhoneNumbersKey, CNContactFamilyNameKey, CNContactGivenNameKey, CNContactPostalAddressesKey];
|
||||
CNContactFetchRequest * request = [[CNContactFetchRequest alloc]initWithKeysToFetch:keysToFetch];
|
||||
BOOL success = [store enumerateContactsWithFetchRequest:request error:&contactError usingBlock:^(CNContact * __nonnull contact, BOOL * __nonnull stop){}];
|
||||
if(success) {
|
||||
LOGD(@"CNContactStore successfully synchronized");
|
||||
}
|
||||
}
|
||||
LOGD(@"CNContactStore authorization granted");
|
||||
}];
|
||||
} else if([CNContactStore authorizationStatusForEntityType:entityType]== CNAuthorizationStatusAuthorized) {
|
||||
NSError* contactError;
|
||||
store = [[CNContactStore alloc]init];
|
||||
[store containersMatchingPredicate:[CNContainer predicateForContainersWithIdentifiers: @[store.defaultContainerIdentifier]] error:&contactError];
|
||||
NSArray * keysToFetch =@[CNContactEmailAddressesKey, CNContactPhoneNumbersKey, CNContactFamilyNameKey, CNContactGivenNameKey, CNContactPostalAddressesKey];
|
||||
CNContactFetchRequest * request = [[CNContactFetchRequest alloc]initWithKeysToFetch:keysToFetch];
|
||||
__block int number_of_contact=0;
|
||||
LOGD(@"CNContactStore synchronizing");
|
||||
BOOL success = [store enumerateContactsWithFetchRequest:request error:&contactError usingBlock:^(CNContact * __nonnull contact, BOOL * __nonnull stop){
|
||||
number_of_contact++;
|
||||
}];
|
||||
if(success) {
|
||||
LOGD(@"CNContactStore [%i] contacts successfully synchronized",number_of_contact);
|
||||
}
|
||||
LOGD(@"CNContactStore authorization granted");
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateAddressBook:) name:CNContactStoreDidChangeNotification object:nil];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue