Add HAVE_SSL definition and settings filter

This commit is contained in:
Yann Diorcet 2012-10-03 12:26:31 +02:00
parent 67c885dab9
commit 711d975b5b
5 changed files with 70 additions and 2 deletions

View file

@ -478,7 +478,9 @@ static void hideSpinner(LinphoneCall* call, void* user_data) {
}];
[sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Decline", nil) block:^() {
[LinphoneLogger logc:LinphoneLoggerLog format:"User declined video proposal"];
linphone_core_accept_call_update([LinphoneManager getLc], call, NULL);
LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_core_accept_call_update([LinphoneManager getLc], call, paramsCopy);
linphone_call_params_destroy(paramsCopy);
[timer invalidate];
}];
[sheet showInView:[PhoneMainView instance].view];

View file

@ -110,6 +110,11 @@
if (currentCall) {
LinphoneCallState state = linphone_call_get_state(currentCall);
switch (state) {
case LinphoneCallUpdating:
{
[self setEnabled:FALSE];
break;
}
case LinphoneCallStreamsRunning:
{
[waitView stopAnimating];

View file

@ -40,6 +40,13 @@
@end
#endif
@interface SettingsViewController (private)
+ (IASKSpecifier*)filterSpecifier:(IASKSpecifier *)specifier;
@end
#pragma mark - IASKSwitchEx Class
@interface IASKSwitchEx : DCRoundSwitch {
@ -189,6 +196,25 @@
[targetViewController release];
}
- (IASKSettingsReader*)settingsReader {
IASKSettingsReader *r = [super settingsReader];
NSMutableArray *dataSource = [NSMutableArray arrayWithArray:[r dataSource]];
for (int i = 0; i < [dataSource count]; ++i) {
NSMutableArray *specifiers = [NSMutableArray arrayWithArray:[dataSource objectAtIndex:i]];
for (int j = 0; j < [specifiers count]; ++j) {
id sp = [specifiers objectAtIndex:j];
if ([sp isKindOfClass:[IASKSpecifier class]]) {
sp = [SettingsViewController filterSpecifier:sp];
}
[specifiers replaceObjectAtIndex:j withObject:sp];
}
[dataSource replaceObjectAtIndex:i withObject:specifiers];
}
[r setDataSource:dataSource];
return r;
}
- (void)viewDidLoad {
[super viewDidLoad];
@ -416,7 +442,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewDidLoad {
[super viewDidLoad];
settingsStore = [[LinphoneCoreSettingsStore alloc] init];
settingsController.showDoneButton = FALSE;
@ -509,6 +535,33 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark -
+ (IASKSpecifier*)filterSpecifier:(IASKSpecifier *)specifier {
#ifndef HAVE_SSL
if ([[specifier key] isEqualToString:@"transport_preference"]) {
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
[titles removeObject:@"TLS"];
[dict setObject:titles forKey:@"Titles"];
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
[values removeObject:@"tls"];
[dict setObject:values forKey:@"Values"];
return [[[IASKSpecifier alloc] initWithSpecifier:dict] autorelease];
} else if ([[specifier key] isEqualToString:@"media_encryption_preference"]) {
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]];
NSMutableArray *titles = [NSMutableArray arrayWithArray:[dict objectForKey:@"Titles"]];
[titles removeObject:@"ZRTP"];
[titles removeObject:@"SRTP"];
[dict setObject:titles forKey:@"Titles"];
NSMutableArray *values = [NSMutableArray arrayWithArray:[dict objectForKey:@"Values"]];
[values removeObject:@"ZRTP"];
[values removeObject:@"SRTP"];
[dict setObject:values forKey:@"Values"];
return [[[IASKSpecifier alloc] initWithSpecifier:dict] autorelease];
}
#endif //HAVE_SSL
return specifier;
}
- (NSSet*)findHiddenKeys {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't filter settings: Linphone core not read"];

View file

@ -137,6 +137,8 @@
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>call_menu</string>
<key>File</key>
<string>Call</string>
<key>Title</key>
@ -145,6 +147,8 @@
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>network_menu</string>
<key>File</key>
<string>Network</string>
<key>Title</key>

View file

@ -5194,6 +5194,7 @@
VIDEO_ENABLED,
HAVE_X264,
HAVE_SILK,
HAVE_SSL,
DEBUG,
);
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
@ -5269,6 +5270,7 @@
VIDEO_ENABLED,
HAVE_X264,
HAVE_SILK,
HAVE_SSL,
);
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
HEADER_SEARCH_PATHS = (
@ -5537,6 +5539,7 @@
VIDEO_ENABLED,
HAVE_X264,
HAVE_SILK,
HAVE_SSL,
);
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
HEADER_SEARCH_PATHS = (
@ -5611,6 +5614,7 @@
VIDEO_ENABLED,
HAVE_X264,
HAVE_SILK,
HAVE_SSL,
);
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
HEADER_SEARCH_PATHS = (