Revert "Fix image sending, there is still an issue with the message state. Not sure why."

This reverts commit 42199f23dc.
This commit is contained in:
Guillaume BIENKOWSKI 2014-05-22 15:55:19 +02:00
parent 78e1ae145c
commit 6b994368da
2 changed files with 6 additions and 7 deletions

View file

@ -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;
}
}

View file

@ -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];
}