Clean chatroom on core destroy

This commit is contained in:
Yann Diorcet 2013-02-21 11:06:37 +01:00
parent b672051864
commit 7d2a79c25b

View file

@ -163,6 +163,11 @@ static UICompositeViewDescription *compositeDescription = nil;
selector:@selector(onMessageChange:)
name:UITextViewTextDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
object:nil];
if([tableController isEditing])
[tableController setEditing:FALSE animated:FALSE];
[editButton setOff];
@ -206,6 +211,9 @@ static UICompositeViewDescription *compositeDescription = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UITextViewTextDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneCoreUpdate
object:nil];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
@ -404,6 +412,12 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta
#pragma mark - Event Functions
- (void)coreUpdateEvent:(NSNotification*)notif {
if(![LinphoneManager isLcReady]) {
chatRoom = NULL;
}
}
- (void)textReceivedEvent:(NSNotification *)notif {
//LinphoneChatRoom *room = [[[notif userInfo] objectForKey:@"room"] pointerValue];
//NSString *message = [[notif userInfo] objectForKey:@"message"];