mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix again
This commit is contained in:
parent
ec8039154c
commit
c613c76fd1
3 changed files with 26 additions and 19 deletions
|
|
@ -124,8 +124,14 @@
|
|||
LOGW(@"event entry doesn't exist");
|
||||
return;
|
||||
}
|
||||
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:index inSection:0]]
|
||||
if (index == (eventList.count-1)) {
|
||||
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]
|
||||
atScrollPosition:UITableViewScrollPositionBottom
|
||||
animated:YES];
|
||||
} else {
|
||||
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:index inSection:0]]
|
||||
withRowAnimation:FALSE]; // just reload
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -171,28 +171,32 @@ static const CGFloat CELL_IMAGE_X_MARGIN = 100;
|
|||
|
||||
BOOL is_outgoing = linphone_chat_message_is_outgoing(self.message);
|
||||
if (!is_outgoing) {
|
||||
LinphoneChatMessageState state = linphone_chat_message_get_state(self.message);
|
||||
if (state != LinphoneChatMessageStateFileTransferDone && state != LinphoneChatMessageStateDisplayed) {
|
||||
if (state == LinphoneChatMessageStateFileTransferInProgress) {
|
||||
_cancelButton.hidden = _fileTransferProgress.hidden = NO;
|
||||
_downloadButton.hidden = YES;
|
||||
_playButton.hidden = YES;
|
||||
_fileName.hidden = _fileView.hidden = _fileButton.hidden =YES;
|
||||
} else {
|
||||
_downloadButton.hidden = NO;
|
||||
_cancelButton.hidden = _fileTransferProgress.hidden = YES;
|
||||
_playButton.hidden = YES;
|
||||
_fileName.hidden = _fileView.hidden = _fileButton.hidden = YES;
|
||||
}
|
||||
if (linphone_chat_message_get_state(self.message) == LinphoneChatMessageStateFileTransferInProgress) {
|
||||
_cancelButton.hidden = _fileTransferProgress.hidden = NO;
|
||||
_downloadButton.hidden = YES;
|
||||
_playButton.hidden = YES;
|
||||
_fileName.hidden = _fileView.hidden = _fileButton.hidden =YES;
|
||||
return;
|
||||
}
|
||||
if (linphone_content_is_file_transfer(fileContent)) {
|
||||
_downloadButton.hidden = NO;
|
||||
_cancelButton.hidden = _fileTransferProgress.hidden = YES;
|
||||
_playButton.hidden = YES;
|
||||
_fileName.hidden = _fileView.hidden = _fileButton.hidden = YES;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NSString *fileType = [NSString stringWithUTF8String:linphone_content_get_type(fileContent)];
|
||||
NSString *fileName = [NSString stringWithUTF8String:linphone_content_get_name(fileContent)];
|
||||
NSString *filePath = [[LinphoneManager cacheDirectory] stringByAppendingPathComponent:fileName];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
|
||||
filePath = [[LinphoneManager cacheDirectory] stringByAppendingPathComponent:(localImage?:(localVideo?:localFile))];
|
||||
NSString *tempName = (localImage?:(localVideo?:localFile));
|
||||
if ([tempName isEqualToString:fileName]) {
|
||||
filePath = [[VIEW(ChatConversationView) getICloudFileUrl:fileName] path];
|
||||
} else {
|
||||
filePath = [[LinphoneManager cacheDirectory] stringByAppendingPathComponent:tempName];
|
||||
}
|
||||
}
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
|
||||
|
|
@ -532,7 +536,6 @@ static const CGFloat CELL_IMAGE_X_MARGIN = 100;
|
|||
} else {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[view.tableController updateEventEntry:self.event];
|
||||
[view.tableController scrollToBottom:true];
|
||||
}
|
||||
}
|
||||
- (void)onFileTransferRecvUpdate:(NSNotification *)notif {
|
||||
|
|
@ -544,7 +547,6 @@ static const CGFloat CELL_IMAGE_X_MARGIN = 100;
|
|||
} else {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[view.tableController updateEventEntry:self.event];
|
||||
[view.tableController scrollToBottom:true];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,6 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
LinphoneEventLog *event = (LinphoneEventLog *)linphone_chat_message_cbs_get_user_data(linphone_chat_message_get_callbacks(msg));
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[view.tableController updateEventEntry:event];
|
||||
[view.tableController scrollToBottom:true];
|
||||
}
|
||||
|
||||
static void participant_imdn_status(LinphoneChatMessage* msg, const LinphoneParticipantImdnState *state) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue