diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index 772c5e530..f32e57d08 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -389,8 +389,9 @@ static UIFont *CELL_FONT = nil; } - (IBAction)onCancelDownloadClick:(id)sender { - [ftd cancel]; + FileTransferDelegate *tmp = ftd; [self disconnectFromFileDelegate]; + [tmp cancel]; [self update]; } @@ -454,20 +455,26 @@ static UIFont *CELL_FONT = nil; static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState state) { UIChatRoomCell *thiz = (__bridge UIChatRoomCell *)linphone_chat_message_get_user_data(msg); LOGI(@"State for message [%p] changed to %s", msg, linphone_chat_message_state_to_string(state)); - if (linphone_chat_message_get_file_transfer_information(msg) != NULL && - (state == LinphoneChatMessageStateDelivered || state == LinphoneChatMessageStateNotDelivered)) { - // we need to refresh the tableview because the filetransfer delegate unreffed - // the chat message before state was LinphoneChatMessageStateFileTransferDone - - // if we are coming back from another view between unreffing and change of state, - // the transient message will not be found and it will not appear in the list of - // message, so we must refresh the table when we change to this state to ensure that - // all transient messages apppear - // ChatRoomViewController *controller = DYNAMIC_CAST( - // [[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] - // push:TRUE], - // ChatRoomViewController); - // [controller.tableController setChatRoom:linphone_chat_message_get_chat_room(msg)]; - // This is breaking interface too much, it must be fixed in file transfer cb.. meanwhile, disabling it. + if (linphone_chat_message_get_file_transfer_information(msg) != NULL) { + if (state == LinphoneChatMessageStateDelivered || state == LinphoneChatMessageStateNotDelivered) { + // we need to refresh the tableview because the filetransfer delegate unreffed + // the chat message before state was LinphoneChatMessageStateFileTransferDone - + // if we are coming back from another view between unreffing and change of state, + // the transient message will not be found and it will not appear in the list of + // message, so we must refresh the table when we change to this state to ensure that + // all transient messages apppear + // ChatRoomViewController *controller = DYNAMIC_CAST( + // [[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] + // push:TRUE], + // ChatRoomViewController); + // [controller.tableController setChatRoom:linphone_chat_message_get_chat_room(msg)]; + // This is breaking interface too much, it must be fixed in file transfer cb.. meanwhile, disabling it. + + if (thiz->ftd) { + [thiz->ftd stopAndDestroy]; + thiz->ftd = nil; + } + } } [thiz update]; } diff --git a/Classes/Utils/FileTransferDelegate.m b/Classes/Utils/FileTransferDelegate.m index 296ade26b..112c62b9b 100644 --- a/Classes/Utils/FileTransferDelegate.m +++ b/Classes/Utils/FileTransferDelegate.m @@ -187,7 +187,7 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m - (void)stopAndDestroy { [[[LinphoneManager instance] fileTransferDelegates] removeObject:self]; if (_message != NULL) { - LOGI(@"%p Cancelling transferm from %p", self, _message); + LOGI(@"%p Cancelling transfer from %p", self, _message); linphone_chat_message_cbs_set_file_transfer_send(linphone_chat_message_get_callbacks(_message), NULL); linphone_chat_message_cbs_set_file_transfer_recv(linphone_chat_message_get_callbacks(_message), NULL); linphone_chat_message_cancel_file_transfer(_message); diff --git a/submodules/linphone b/submodules/linphone index e48f88ff2..3312e8be0 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit e48f88ff27133a6a4d127d5400a1fdf68f0c5c3b +Subproject commit 3312e8be0bc8336aecf6feffc4cdae9b1cc6904a