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

This commit is contained in:
Guillaume BIENKOWSKI 2014-05-22 11:24:18 +02:00
parent 041ab29d08
commit 42199f23dc
2 changed files with 7 additions and 6 deletions

View file

@ -43,8 +43,6 @@
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[TUNinePatchCache flushCache]; // Clear cache
[self clearMessageList];
chatRoom = NULL;
}
- (void)viewWillAppear:(BOOL)animated {
[self reloadData];
@ -110,7 +108,10 @@
int count = 0;
while (item) {
LinphoneChatMessage* msg = (LinphoneChatMessage*)item->data;
NSLog(@"Message %d: %s", count++, linphone_chat_message_get_text(msg));
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);
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,7 +250,6 @@ 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 {
@ -307,8 +306,9 @@ 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 [%s] is [%s]",text,linphone_chat_message_state_to_string(state)];
format:@"Delivery status for %p [%s] is [%s]",msg, text?text:url,linphone_chat_message_state_to_string(state)];
[thiz.tableController updateChatEntry:msg];
}