Merge branch 'new_ui' of git://git.linphone.org/linphone-iphone into buschjaeger_new_ui

Conflicts:
	Classes/LinphoneAppDelegate.m
	Classes/LinphoneCoreSettingsStore.m
	Classes/LinphoneManager.m
	Classes/LinphoneUI/UIStateBar.m
	Classes/PhoneMainView.h
	Classes/PhoneMainView.m
This commit is contained in:
Yann Diorcet 2012-09-12 18:01:52 +02:00
commit b6b43f3ff5
6 changed files with 26 additions and 41 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
build-*
*.locuser
.DS_Store
liblinphone-sdk

View file

@ -245,6 +245,7 @@
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Receive %@", userInfo];
/* MODIFICATION: Remove remote notification
NSDictionary *aps = [userInfo objectForKey:@"aps"];
if(aps != nil) {
NSDictionary *alert = [aps objectForKey:@"alert"];
@ -252,22 +253,21 @@
NSString *loc_key = [alert objectForKey:@"loc-key"];
/*if we receive a remote notification, it is because our TCP background socket was no more working.
As a result, break it and refresh registers in order to make sure to receive incoming INVITE or MESSAGE*/
LinphoneCore *lc=[LinphoneManager getLc];
linphone_core_set_network_reachable(lc,FALSE);
linphone_core_set_network_reachable(lc,TRUE);
LinphoneCore *lc = [LinphoneManager getLc];
linphone_core_set_network_reachable(lc, FALSE);
linphone_core_set_network_reachable(lc, TRUE);
if(loc_key != nil) {
if([loc_key isEqualToString:@"IM_MSG"]) {
/* MODIFICATION: Remove remote notification
[[LinphoneManager instance] addInhibitedEvent:kLinphoneTextReceivedSound];
[[PhoneMainView instance] addInhibitedEvent:kLinphoneTextReceived];
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
*/
}else{
//it's a call
[[LinphoneManager instance] didReceiveRemoteNotification];
}
} else if([loc_key isEqualToString:@"IC_MSG"]) {
//it's a call
[[LinphoneManager instance] didReceiveRemoteNotification];
}
}
}
}
*/
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {

View file

@ -32,7 +32,6 @@
extern NSString *const kLinphoneDisplayStatusUpdate;
extern NSString *const kLinphoneTextReceived;
extern NSString *const kLinphoneTextReceivedSound;
extern NSString *const kLinphoneCallUpdate;
extern NSString *const kLinphoneRegistrationUpdate;
extern NSString *const kLinphoneMainViewChange;
@ -85,7 +84,6 @@ typedef struct _LinphoneManagerSounds {
time_t lastRemoteNotificationTime;
Connectivity connectivity;
BOOL stopWaitingRegisters;
NSMutableArray *inhibitedEvent;
/* MODIFICATION: Add NSUSerdefault settings */
NSDictionary *currentSettings;
@ -121,9 +119,6 @@ typedef struct _LinphoneManagerSounds {
- (void)refreshRegisters;
- (void)addInhibitedEvent:(NSString*)event;
- (BOOL)removeInhibitedEvent:(NSString*)event;
+ (BOOL)copyFile:(NSString*)src destination:(NSString*)dst override:(BOOL)override;
+ (NSString*)bundleFile:(NSString*)file;
+ (NSString*)documentFile:(NSString*)file;

View file

@ -38,7 +38,6 @@ static LinphoneManager* theLinphoneManager = nil;
NSString *const kLinphoneDisplayStatusUpdate = @"LinphoneDisplayStatusUpdate";
NSString *const kLinphoneTextReceived = @"LinphoneTextReceived";
NSString *const kLinphoneTextReceivedSound = @"LinphoneTextReceivedSound";
NSString *const kLinphoneCallUpdate = @"LinphoneCallUpdate";
NSString *const kLinphoneRegistrationUpdate = @"LinphoneRegistrationUpdate";
/* MODIFICATION: Add buschjaeger configuration event */
@ -213,7 +212,6 @@ struct codec_name_pref_table codec_pref_table[]={
sounds.level = 0;
/**/
inhibitedEvent = [[NSMutableArray alloc] init];
logs = [[NSMutableArray alloc] init];
database = NULL;
speakerEnabled = FALSE;
@ -221,7 +219,7 @@ struct codec_name_pref_table codec_pref_table[]={
[self openDatabase];
/**/
[self copyDefaultSettings];
lastRemoteNotificationTime=0;
/* MODIFICATION: Add buschjaeger configuration */
configuration = [[BuschJaegerConfiguration alloc] init];
[configuration loadFile:kLinphoneConfigurationPath];
@ -238,7 +236,6 @@ struct codec_name_pref_table codec_pref_table[]={
AudioServicesDisposeSystemSoundID(sounds.message);
}
[inhibitedEvent release];
[fastAddressBook release];
[self closeDatabase];
[logs release];
@ -739,7 +736,6 @@ static LinphoneCoreVTable linphonec_vtable = {
}
}
- (void)destroyLibLinphone {
[mIterateTimer invalidate];
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
@ -758,16 +754,16 @@ static LinphoneCoreVTable linphonec_vtable = {
}
- (void)didReceiveRemoteNotification{
lastRemoteNotificationTime=time(NULL);
lastRemoteNotificationTime=time(NULL);
}
- (BOOL)shouldAutoAcceptCall{
if (lastRemoteNotificationTime!=0){
if ((time(NULL)-lastRemoteNotificationTime)<15)
return TRUE;
lastRemoteNotificationTime=0;
}
return FALSE;
if (lastRemoteNotificationTime!=0){
if ((time(NULL)-lastRemoteNotificationTime)<15)
return TRUE;
lastRemoteNotificationTime=0;
}
return FALSE;
}
- (BOOL)resignActive {
@ -1037,19 +1033,6 @@ static void audioRouteChangeListenerCallback (
*/
}
- (void)addInhibitedEvent:(NSString*)event {
[inhibitedEvent addObject:event];
}
- (BOOL)removeInhibitedEvent:(NSString*)event {
NSUInteger index = [inhibitedEvent indexOfObject:kLinphoneTextReceivedSound];
if(index != NSNotFound) {
[inhibitedEvent removeObjectAtIndex:index];
return TRUE;
}
return FALSE;
}
#pragma mark - Misc Functions
@ -1389,7 +1372,7 @@ static void audioRouteChangeListenerCallback (
-(void)lpConfigSetString:(NSString*) value forKey:(NSString*) key {
lp_config_set_string(linphone_core_get_config(theLinphoneCore),"app",value?[key UTF8String]:NULL, [value UTF8String]);
lp_config_set_string(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String], value?[value UTF8String]:NULL);
}
-(NSString*)lpConfigStringForKey:(NSString*) key {
if (!theLinphoneCore) {

View file

@ -74,6 +74,9 @@
ret = [ret substringFromIndex:4];
}
ret = [@"sip:" stringByAppendingString:ret];
if([ret hasSuffix:@":5060"]) {
ret = [ret substringToIndex:[ret length] - 5];
}
}
return ret;
}

2
linphone.xcodeproj/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
project.xcworkspace
xcuserdata