From 6b994368da36fca7d60ef13056fcecdeecfd2dcb Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 22 May 2014 15:55:19 +0200 Subject: [PATCH] Revert "Fix image sending, there is still an issue with the message state. Not sure why." This reverts commit 42199f23dce91ca774a67ccf31d1924dc792275f. --- Classes/ChatRoomTableViewController.m | 7 +++---- Classes/ChatRoomViewController.m | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 322506f6a..3969d097f 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -43,6 +43,8 @@ - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [TUNinePatchCache flushCache]; // Clear cache + [self clearMessageList]; + chatRoom = NULL; } - (void)viewWillAppear:(BOOL)animated { [self reloadData]; @@ -108,10 +110,7 @@ int count = 0; while (item) { LinphoneChatMessage* msg = (LinphoneChatMessage*)item->data; - const char* text = linphone_chat_message_get_text(msg); - const char* url = linphone_chat_message_get_external_body_url(msg); - const char* state = linphone_chat_message_state_to_string(linphone_chat_message_get_state(msg)); - NSLog(@"Message %d type %s (%s): %s", count++, text?"TEXT":"IMG", state,text?text:url); + NSLog(@"Message %d: %s", count++, linphone_chat_message_get_text(msg)); item = item->next; } } diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 571645564..8753413d9 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -197,7 +197,7 @@ static UICompositeViewDescription *compositeDescription = nil; [messageField resignFirstResponder]; - //chatRoom = NULL; + chatRoom = NULL; [self setComposingVisible:FALSE withDelay:0]; // will hide the "user is composing.." message @@ -250,6 +250,7 @@ static UICompositeViewDescription *compositeDescription = nil; [self update]; linphone_chat_room_mark_as_read(chatRoom); [self setComposingVisible:linphone_chat_room_is_remote_composing(chatRoom) withDelay:0]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self]; } - (void)applicationWillEnterForeground:(NSNotification*)notif { @@ -306,9 +307,8 @@ static UICompositeViewDescription *compositeDescription = nil; static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud) { ChatRoomViewController* thiz = (ChatRoomViewController*)ud; const char*text = linphone_chat_message_get_text(msg); - const char*url = linphone_chat_message_get_external_body_url(msg); [LinphoneLogger log:LinphoneLoggerLog - format:@"Delivery status for %p [%s] is [%s]",msg, text?text:url,linphone_chat_message_state_to_string(state)]; + format:@"Delivery status for [%s] is [%s]",text,linphone_chat_message_state_to_string(state)]; [thiz.tableController updateChatEntry:msg]; }