mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
Use constants for Linphone events
This commit is contained in:
parent
29e838be54
commit
6ee203e0c2
21 changed files with 118 additions and 59 deletions
|
|
@ -17,6 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "LinphoneManager.h"
|
||||
#import "ChatRoomTableViewController.h"
|
||||
#import "UIChatRoomCell.h"
|
||||
#import "Utils.h"
|
||||
|
|
@ -108,7 +109,7 @@
|
|||
self->remoteAddress = [aremoteAddress copy];
|
||||
[self loadData];
|
||||
[ChatModel readConversation:remoteAddress];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneTextReceived" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textReceivedEvent:)
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
if([tableController isEditing])
|
||||
[tableController setEditing:FALSE animated:FALSE];
|
||||
|
|
@ -130,7 +130,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
name:UIKeyboardWillHideNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
@ -223,7 +223,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
caseInsensitiveCompare:remoteAddress] == NSOrderedSame) {
|
||||
[chat setRead:[NSNumber numberWithInt:1]];
|
||||
[chat update];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneTextReceived" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self];
|
||||
[tableController addChatEntry:chat];
|
||||
}
|
||||
ms_free(fromStr);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
[data removeObjectAtIndex:[indexPath row]];
|
||||
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
|
||||
[tableView endUpdates];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneTextReceived" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
[super viewWillAppear:animated];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textReceivedEvent:)
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
if([tableController isEditing])
|
||||
[tableController setEditing:FALSE animated:FALSE];
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
[super viewWillDisappear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C
|
|||
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i);
|
||||
BOOL add = false;
|
||||
if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
|
||||
if(CFStringCompare((CFStringRef)CONTACT_SIP_FIELD, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) {
|
||||
if(CFStringCompare((CFStringRef)kContactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) {
|
||||
add = true;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -272,7 +272,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C
|
|||
lMap = ABMultiValueCreateMutable(kABDictionaryPropertyType);
|
||||
}
|
||||
CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey };
|
||||
CFTypeRef values[] = { [value copy], CONTACT_SIP_FIELD };
|
||||
CFTypeRef values[] = { [value copy], kContactSipField };
|
||||
CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 1, NULL, NULL);
|
||||
CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0];
|
||||
if(!ABMultiValueAddValueAndLabel(lMap, lDict, label, &identifier)) {
|
||||
|
|
@ -712,7 +712,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C
|
|||
CFRelease(lcMap);
|
||||
int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]);
|
||||
CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey};
|
||||
CFTypeRef values[] = { [value copy], CONTACT_SIP_FIELD };
|
||||
CFTypeRef values[] = { [value copy], kContactSipField };
|
||||
CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL);
|
||||
ABMultiValueReplaceValueAtIndex(lMap, lDict, index);
|
||||
CFRelease(lDict);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
// Set observer
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(callUpdateEvent:)
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
// Update on show
|
||||
if([LinphoneManager isLcReady]) {
|
||||
|
|
@ -137,7 +137,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
// Remove observer
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#import "LinphoneManager.h"
|
||||
#import "FirstLoginViewController.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
|
@ -76,7 +76,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
// Set observer
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(registrationUpdateEvent:)
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
|
||||
[usernameField setText:[[LinphoneManager instance].settingsStore objectForKey:@"username_preference"]];
|
||||
|
|
@ -97,7 +97,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
// Remove observer
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(update:)
|
||||
name:@"LinphoneAddressBookUpdate"
|
||||
name:kLinphoneAddressBookUpdate
|
||||
object:nil];
|
||||
[self update];
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[super viewWillDisappear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneAddressBookUpdate"
|
||||
name:kLinphoneAddressBookUpdate
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
// Reset missed call
|
||||
linphone_core_reset_missed_calls_count([LinphoneManager getLc]);
|
||||
// Fake event
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
// Remove observer
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
// Set observer
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(callUpdateEvent:)
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
|
||||
// Update on show
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(callUpdateEvent:)
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
[super viewWillDisappear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -186,6 +186,19 @@ int __aeabi_idiv(int a, int b) {
|
|||
|
||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
|
||||
[LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Receive %@", userInfo];
|
||||
NSDictionary *aps = [userInfo objectForKey:@"aps"];
|
||||
if(aps != nil) {
|
||||
NSDictionary *alert = [aps objectForKey:@"alert"];
|
||||
if(alert != nil) {
|
||||
NSString *loc_key = [alert objectForKey:@"loc-key"];
|
||||
if(loc_key != nil) {
|
||||
if([loc_key isEqualToString:@"IM_MSG"]) {
|
||||
[[LinphoneManager instance] addInhibitedEvent:kLinphoneTextReceivedSound];
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,14 @@
|
|||
|
||||
#include "linphonecore.h"
|
||||
|
||||
extern const NSString *CONTACT_SIP_FIELD;
|
||||
extern NSString *const kLinphoneTextReceived;
|
||||
extern NSString *const kLinphoneTextReceivedSound;
|
||||
extern NSString *const kLinphoneCallUpdate;
|
||||
extern NSString *const kLinphoneRegistrationUpdate;
|
||||
extern NSString *const kLinphoneMainViewChange;
|
||||
extern NSString *const kLinphoneAddressBookUpdate;
|
||||
|
||||
extern NSString *const kContactSipField;
|
||||
|
||||
typedef enum _Connectivity {
|
||||
wifi,
|
||||
|
|
@ -56,6 +63,11 @@ typedef struct _LinphoneCallAppData {
|
|||
UILocalNotification *notification;
|
||||
} LinphoneCallAppData;
|
||||
|
||||
typedef struct _LinphoneManagerSounds {
|
||||
SystemSoundID call;
|
||||
SystemSoundID message;
|
||||
} LinphoneManagerSounds;
|
||||
|
||||
@interface LinphoneManager : NSObject <AVAudioSessionDelegate> {
|
||||
@protected
|
||||
SCNetworkReachabilityRef proxyReachability;
|
||||
|
|
@ -70,15 +82,14 @@ typedef struct _LinphoneCallAppData {
|
|||
|
||||
FastAddressBook* fastAddressBook;
|
||||
|
||||
LinphoneManagerSounds sounds;
|
||||
NSMutableArray *inhibitedEvent;
|
||||
id<IASKSettingsStore> settingsStore;
|
||||
sqlite3 *database;
|
||||
|
||||
|
||||
@public
|
||||
CallContext currentCallContextBeforeGoingBackground;
|
||||
struct _Sounds {
|
||||
SystemSoundID callSound;
|
||||
SystemSoundID messageSound;
|
||||
} sounds;
|
||||
}
|
||||
+ (LinphoneManager*)instance;
|
||||
#ifdef DEBUG
|
||||
|
|
@ -105,6 +116,9 @@ typedef struct _LinphoneCallAppData {
|
|||
- (void)enableSpeaker:(BOOL)enable;
|
||||
- (BOOL)isSpeakerEnabled;
|
||||
|
||||
- (void)addInhibitedEvent:(NSString*)event;
|
||||
- (BOOL)removeInhibitedEvent:(NSString*)event;
|
||||
|
||||
- (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer;
|
||||
|
||||
@property (nonatomic, retain) id<IASKSettingsStore> settingsStore;
|
||||
|
|
@ -115,6 +129,7 @@ typedef struct _LinphoneCallAppData {
|
|||
@property (readonly) const char* backCamId;
|
||||
@property (readonly) sqlite3* database;
|
||||
@property (nonatomic, retain) NSData *pushNotificationToken;
|
||||
@property (readonly) LinphoneManagerSounds sounds;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -35,9 +35,16 @@
|
|||
#include "lpconfig.h"
|
||||
#include "private.h"
|
||||
|
||||
static LinphoneCore* theLinphoneCore=nil;
|
||||
static LinphoneManager* theLinphoneManager=nil;
|
||||
const NSString *CONTACT_SIP_FIELD = @"SIP";
|
||||
static LinphoneCore* theLinphoneCore = nil;
|
||||
static LinphoneManager* theLinphoneManager = nil;
|
||||
|
||||
NSString *const kLinphoneTextReceived = @"LinphoneTextReceived";
|
||||
NSString *const kLinphoneTextReceivedSound = @"LinphoneTextReceivedSound";
|
||||
NSString *const kLinphoneCallUpdate = @"LinphoneCallUpdate";
|
||||
NSString *const kLinphoneRegistrationUpdate = @"LinphoneRegistrationUpdate";
|
||||
NSString *const kLinphoneAddressBookUpdate = @"LinphoneAddressBookUpdate";
|
||||
NSString *const kLinphoneMainViewChange = @"LinphoneMainViewChange";
|
||||
NSString *const kContactSipField = @"SIP";
|
||||
|
||||
extern void libmsilbc_init();
|
||||
#ifdef HAVE_AMR
|
||||
|
|
@ -68,6 +75,7 @@ extern void libmsbcg729_init();
|
|||
@synthesize database;
|
||||
@synthesize fastAddressBook;
|
||||
@synthesize pushNotificationToken;
|
||||
@synthesize sounds;
|
||||
|
||||
struct codec_name_pref_table{
|
||||
const char *name;
|
||||
|
|
@ -172,19 +180,21 @@ struct codec_name_pref_table codec_pref_table[]={
|
|||
|
||||
{
|
||||
NSString *path = [[NSBundle mainBundle] pathForResource:@"ring" ofType:@"wav"];
|
||||
OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.callSound);
|
||||
sounds.call = 0;
|
||||
OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.call);
|
||||
if(status != 0){
|
||||
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't set \"call\" system sound"];
|
||||
}
|
||||
}
|
||||
{
|
||||
NSString *path = [[NSBundle mainBundle] pathForResource:@"msg" ofType:@"wav"];
|
||||
OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.messageSound);
|
||||
sounds.message = 0;
|
||||
OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.message);
|
||||
if(status != 0){
|
||||
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't set \"message\" system sound"];
|
||||
}
|
||||
}
|
||||
|
||||
inhibitedEvent = [[NSMutableArray alloc] init];
|
||||
database = NULL;
|
||||
settingsStore = nil;
|
||||
self.defaultExpires = 600;
|
||||
|
|
@ -194,9 +204,14 @@ struct codec_name_pref_table codec_pref_table[]={
|
|||
}
|
||||
|
||||
- (void)dealloc {
|
||||
AudioServicesDisposeSystemSoundID(sounds.callSound);
|
||||
AudioServicesDisposeSystemSoundID(sounds.messageSound);
|
||||
if(sounds.call) {
|
||||
AudioServicesDisposeSystemSoundID(sounds.call);
|
||||
}
|
||||
if(sounds.message) {
|
||||
AudioServicesDisposeSystemSoundID(sounds.message);
|
||||
}
|
||||
|
||||
[inhibitedEvent release];
|
||||
[fastAddressBook release];
|
||||
[self closeDatabase];
|
||||
[settingsStore release];
|
||||
|
|
@ -905,4 +920,17 @@ static LinphoneCoreVTable linphonec_vtable = {
|
|||
}
|
||||
}
|
||||
|
||||
- (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;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@
|
|||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(callUpdateEvent:)
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
// Update on show
|
||||
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
|
|
@ -219,7 +219,7 @@
|
|||
[super viewWillDisappear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,15 +63,15 @@
|
|||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(changeViewEvent:)
|
||||
name:@"LinphoneMainViewChange"
|
||||
name:kLinphoneMainViewChange
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(callUpdate:)
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textReceived:)
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
[self update:FALSE];
|
||||
}
|
||||
|
|
@ -80,13 +80,13 @@
|
|||
[super viewWillDisappear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneMainViewChange"
|
||||
name:kLinphoneMainViewChange
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@
|
|||
linphone_core_leave_conference([LinphoneManager getLc]);
|
||||
|
||||
// Fake event
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
|
||||
break;
|
||||
}
|
||||
case UIPauseButtonType_CurrentCall:
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
{
|
||||
linphone_core_enter_conference([LinphoneManager getLc]);
|
||||
// Fake event
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
|
||||
break;
|
||||
}
|
||||
case UIPauseButtonType_CurrentCall:
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ NSTimer *callSecurityTimer;
|
|||
// Set observer
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(registrationUpdate:)
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ NSTimer *callSecurityTimer;
|
|||
|
||||
// Remove observer
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
|
||||
if(callQualityTimer != nil) {
|
||||
|
|
|
|||
|
|
@ -102,15 +102,15 @@ static PhoneMainView* phoneMainViewInstance=nil;
|
|||
// Set observers
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(callUpdate:)
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(registrationUpdate:)
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textReceived:)
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(batteryLevelChanged:)
|
||||
|
|
@ -128,13 +128,13 @@ static PhoneMainView* phoneMainViewInstance=nil;
|
|||
|
||||
// Remove observers
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneCallUpdate"
|
||||
name:kLinphoneCallUpdate
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneTextReceived"
|
||||
name:kLinphoneTextReceived
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:UIDeviceBatteryLevelDidChangeNotification
|
||||
|
|
@ -494,7 +494,7 @@ static PhoneMainView* phoneMainViewInstance=nil;
|
|||
}
|
||||
|
||||
NSDictionary* mdict = [NSMutableDictionary dictionaryWithObject:currentView forKey:@"view"];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:mdict];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMainViewChange object:self userInfo:mdict];
|
||||
|
||||
return [mainViewController getCurrentViewController];
|
||||
}
|
||||
|
|
@ -595,7 +595,9 @@ static PhoneMainView* phoneMainViewInstance=nil;
|
|||
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
|
||||
}
|
||||
} else {
|
||||
AudioServicesPlaySystemSound([LinphoneManager instance]->sounds.messageSound);
|
||||
if(![[LinphoneManager instance] removeInhibitedEvent:kLinphoneTextReceivedSound]) {
|
||||
AudioServicesPlaySystemSound([LinphoneManager instance].sounds.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@
|
|||
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i);
|
||||
BOOL add = false;
|
||||
if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
|
||||
if(CFStringCompare((CFStringRef)CONTACT_SIP_FIELD, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) {
|
||||
if(CFStringCompare((CFStringRef)kContactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) {
|
||||
add = true;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
}
|
||||
CFRelease(lContacts);
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneAddressBookUpdate" object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneAddressBookUpdate object:self];
|
||||
}
|
||||
|
||||
void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(registrationUpdateEvent:)
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
|
|
@ -141,7 +141,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"LinphoneRegistrationUpdate"
|
||||
name:kLinphoneRegistrationUpdate
|
||||
object:nil];
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue