diff --git a/Classes/LinphoneUI/UIChatBubblePhotoCell.m b/Classes/LinphoneUI/UIChatBubblePhotoCell.m index 66a183cd8..a568f0940 100644 --- a/Classes/LinphoneUI/UIChatBubblePhotoCell.m +++ b/Classes/LinphoneUI/UIChatBubblePhotoCell.m @@ -212,8 +212,7 @@ static const CGFloat CELL_IMAGE_X_MARGIN = 100; } // we are uploading the image if (_ftd.message != nil) { - _cancelButton.hidden = NO; - _fileTransferProgress.hidden = NO; + _cancelButton.hidden = _fileTransferProgress.hidden = super.notDelivered ? YES : NO; _downloadButton.hidden = YES; _playButton.hidden = YES; _fileName.hidden = _fileView.hidden = _fileButton.hidden =YES; diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.h b/Classes/LinphoneUI/UIChatBubbleTextCell.h index 69797cea3..d3f7ce842 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.h +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.h @@ -44,6 +44,7 @@ @property(nonatomic) Boolean isFirst; @property(nonatomic) Boolean isLast; +@property(nonatomic) Boolean notDelivered; + (CGSize)ViewSizeForMessage:(LinphoneChatMessage *)chat withWidth:(int)width; + (CGSize)ViewHeightForMessageText:(LinphoneChatMessage *)chat withWidth:(int)width textForImdn:(NSString *)imdnText; diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.m b/Classes/LinphoneUI/UIChatBubbleTextCell.m index b5ffb87cb..fc9c39f96 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.m +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.m @@ -49,7 +49,7 @@ UITapGestureRecognizer *resendRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onResend)]; resendRecognizer.numberOfTapsRequired = 1; - [_imdmIcon addGestureRecognizer:resendRecognizer]; + [_bubbleView addGestureRecognizer:resendRecognizer]; _imdmIcon.userInteractionEnabled = YES; UITapGestureRecognizer *resendRecognizer2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onResend)]; @@ -127,8 +127,6 @@ return; } - //_statusInProgressSpinner.accessibilityLabel = @"Delivery in progress"; - if (_messageText && ![LinphoneManager getMessageAppDataForKey:@"localvideo" inMessage:_message]) { [_messageText setHidden:FALSE]; /* We need to use an attributed string here so that data detector don't mess @@ -212,18 +210,7 @@ CGRect frame = _innerView.frame; frame.origin.y = _isFirst ? 20 : 0; _innerView.frame = frame; - - - //_contactDateLabel.textColor = [UIColor colorWithPatternImage:_backgroundColorImage.image]; - - /*if (outgoing && state == LinphoneChatMessageStateInProgress) { - [_statusInProgressSpinner startAnimating]; - } else if (!outgoing && state == LinphoneChatMessageStateFileTransferError) { - [_statusInProgressSpinner stopAnimating]; - } else { - [_statusInProgressSpinner stopAnimating]; - }*/ - + [_messageText setAccessibilityLabel:outgoing ? @"Outgoing message" : @"Incoming message"]; if (outgoing && (state == LinphoneChatMessageStateDeliveredToUser || state == LinphoneChatMessageStateDisplayed || @@ -231,13 +218,6 @@ [self displayImdmStatus:state]; } else [self displayImdmStatus:LinphoneChatMessageStateInProgress]; - - /*if (!outgoing && !linphone_chat_message_is_secured(_message) && - linphone_core_lime_enabled(LC) == LinphoneLimeMandatory) { - _LIMEKO.hidden = FALSE; - } else { - _LIMEKO.hidden = TRUE; - }*/ } - (void)setEditing:(BOOL)editing { @@ -377,27 +357,19 @@ static void participant_imdn_status(LinphoneChatMessage* msg, const LinphonePart - (void)displayImdmStatus:(LinphoneChatMessageState)state { NSString *imageName = nil; + _notDelivered = FALSE; if (state == LinphoneChatMessageStateDeliveredToUser) { imageName = @"chat_delivered.png"; - //[_imdmLabel setText:NSLocalizedString(@"Delivered", nil)]; - //[_imdmLabel setTextColor:[UIColor grayColor]]; [_imdmIcon setHidden:FALSE]; - //[_imdmLabel setHidden:FALSE]; } else if (state == LinphoneChatMessageStateDisplayed) { imageName = @"chat_read"; - //[_imdmLabel setText:NSLocalizedString(@"Read", nil)]; - //[_imdmLabel setTextColor:([UIColor colorWithRed:(24 / 255.0) green:(167 / 255.0) blue:(175 / 255.0) alpha:1.0])]; [_imdmIcon setHidden:FALSE]; - //[_imdmLabel setHidden:FALSE]; } else if (state == LinphoneChatMessageStateNotDelivered || state == LinphoneChatMessageStateFileTransferError) { imageName = @"chat_error"; - //[_imdmLabel setText:NSLocalizedString(@"Resend", nil)]; - //[_imdmLabel setTextColor:[UIColor redColor]]; [_imdmIcon setHidden:FALSE]; - //[_imdmLabel setHidden:FALSE]; + _notDelivered = TRUE; } else { [_imdmIcon setHidden:TRUE]; - //[_imdmLabel setHidden:TRUE]; } [_imdmIcon setImage:[UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] bundlePath],imageName]]]; }