diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index bae83dd30..17dd31f60 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -102,6 +102,7 @@ [self.tableView reloadData]; size_t count = bctbx_list_size(messageList); if (count) { + [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:(count - 1) inSection:0]]; [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(count - 1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 08cce12d4..ad5b9a4c6 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1963,15 +1963,10 @@ static BOOL libStarted = FALSE; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; } - // Disable notify policy + // Enable notify policy for all LinphoneImNotifPolicy *im_notif_policy; im_notif_policy = linphone_core_get_im_notif_policy(theLinphoneCore); - if (im_notif_policy != NULL) { - /* The IM notification policy can be NULL at this point in case of remote provisioning. */ - linphone_im_notif_policy_clear(im_notif_policy); - linphone_im_notif_policy_set_send_is_composing(im_notif_policy, TRUE); - linphone_im_notif_policy_set_recv_is_composing(im_notif_policy, TRUE); - } + linphone_im_notif_policy_enable_all(im_notif_policy); if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { // go directly to bg mode diff --git a/Classes/LinphoneUI/Base.lproj/UIChatBubblePhotoCell.xib b/Classes/LinphoneUI/Base.lproj/UIChatBubblePhotoCell.xib index dfd3370df..46e90ad66 100644 --- a/Classes/LinphoneUI/Base.lproj/UIChatBubblePhotoCell.xib +++ b/Classes/LinphoneUI/Base.lproj/UIChatBubblePhotoCell.xib @@ -1,5 +1,5 @@ - - + + @@ -22,6 +22,8 @@ + + @@ -30,16 +32,16 @@ - - + + - + - + @@ -108,7 +110,7 @@ - + @@ -125,6 +127,18 @@ + + @@ -134,7 +148,7 @@ - + @@ -156,6 +170,7 @@ + diff --git a/Classes/LinphoneUI/Base.lproj/UIChatBubbleTextCell.xib b/Classes/LinphoneUI/Base.lproj/UIChatBubbleTextCell.xib index bec5dd5da..7b6f67246 100644 --- a/Classes/LinphoneUI/Base.lproj/UIChatBubbleTextCell.xib +++ b/Classes/LinphoneUI/Base.lproj/UIChatBubbleTextCell.xib @@ -1,5 +1,5 @@ - - + + @@ -17,6 +17,8 @@ + + @@ -29,16 +31,16 @@ - - + + - + - + @@ -67,21 +69,33 @@ - + - - + + + + + + + + @@ -91,6 +105,7 @@ + @@ -98,6 +113,7 @@ + diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.h b/Classes/LinphoneUI/UIChatBubbleTextCell.h index 89e89ba0a..9c3d71762 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.h +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.h @@ -37,6 +37,8 @@ @property(strong, nonatomic) IBOutlet UIView *bubbleView; @property(strong, nonatomic) IBOutlet UITapGestureRecognizer *resendRecognizer; @property(weak, nonatomic) IBOutlet UIImageView *LIMEKO; +@property(weak, nonatomic) IBOutlet UIImageView *imdmIcon; +@property(weak, nonatomic) IBOutlet UILabel *imdmLabel; + (CGSize)ViewSizeForMessage:(LinphoneChatMessage *)chat withWidth:(int)width; @@ -46,6 +48,7 @@ - (IBAction)onResendClick:(id)event; - (void)update; +- (void)displayImdmStatus:(LinphoneChatMessageState)state; + (CGSize)ViewHeightForMessage:(LinphoneChatMessage *)chat withWidth:(int)width; + (NSString *)TextMessageForChat:(LinphoneChatMessage *)message; + (CGSize)computeBoundingBox:(NSString *)text size:(CGSize)size font:(UIFont *)font; diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.m b/Classes/LinphoneUI/UIChatBubbleTextCell.m index 54caca958..ebaef798e 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.m +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.m @@ -138,16 +138,17 @@ if (outgoing && state == LinphoneChatMessageStateInProgress) { _statusErrorImage.hidden = YES; [_statusInProgressSpinner startAnimating]; - } else if (outgoing && - (state == LinphoneChatMessageStateNotDelivered || state == LinphoneChatMessageStateFileTransferError)) { - _statusErrorImage.hidden = NO; - [_statusInProgressSpinner stopAnimating]; + } /* else if (outgoing && + (state == LinphoneChatMessageStateNotDelivered || state == LinphoneChatMessageStateFileTransferError)) { + _statusErrorImage.hidden = NO; + [_statusInProgressSpinner stopAnimating]; - NSAttributedString *resend_text = - [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Resend", @"Resend") - attributes:@{NSForegroundColorAttributeName : [UIColor redColor]}]; - [_contactDateLabel setAttributedText:resend_text]; - } else if (!outgoing && state == LinphoneChatMessageStateFileTransferError) { + NSAttributedString *resend_text = + [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Resend", @"Resend") + attributes:@{NSForegroundColorAttributeName : [UIColor redColor]}]; + [_contactDateLabel setAttributedText:resend_text]; + }*/ + else if (!outgoing && state == LinphoneChatMessageStateFileTransferError) { _statusErrorImage.hidden = NO; [_statusInProgressSpinner stopAnimating]; } else { @@ -159,7 +160,15 @@ [_messageText setAccessibilityLabel:@"Outgoing message"]; } else { [_messageText setAccessibilityLabel:@"Incoming message"]; + //[self hideImdmIcons]; } + // TODO : Message deliver and displayed + if (outgoing && + (state == LinphoneChatMessageStateDeliveredToUser || state == LinphoneChatMessageStateDisplayed || + state == LinphoneChatMessageStateNotDelivered || state == LinphoneChatMessageStateFileTransferError)) { + [self displayImdmStatus:state]; + } else + [self displayImdmStatus:LinphoneChatMessageStateInProgress]; if (!outgoing && !linphone_chat_message_is_secured(_message) && linphone_core_lime_enabled(LC) == LinphoneLimeMandatory) { @@ -251,6 +260,31 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st [view.tableController updateChatEntry:msg]; } +- (void)displayImdmStatus:(LinphoneChatMessageState)state { + if (state == LinphoneChatMessageStateDeliveredToUser) { //|| state == LinphoneChatMessageStateDelivered){ + [_imdmIcon setImage:[UIImage imageNamed:@"valid_disabled"]]; + [_imdmLabel setText:NSLocalizedString(@"Delivered", nil)]; + //[_imdmLabel setTextColor:[UIColor blueColor]]; + [_imdmIcon setHidden:FALSE]; + [_imdmLabel setHidden:FALSE]; + } else if (state == LinphoneChatMessageStateDisplayed) { + [_imdmIcon setImage:[UIImage imageNamed:@"valid_default"]]; + [_imdmLabel setText:NSLocalizedString(@"Displayed", nil)]; + //[_imdmLabel setTextColor:[UIColor greenColor]]; + [_imdmIcon setHidden:FALSE]; + [_imdmLabel setHidden:FALSE]; + } else if (state == LinphoneChatMessageStateNotDelivered || state == LinphoneChatMessageStateFileTransferError) { + [_imdmIcon setImage:[UIImage imageNamed:@"chat_message_not_delivered"]]; + [_imdmLabel setText:NSLocalizedString(@"Resend", nil)]; + [_imdmLabel setTextColor:[UIColor redColor]]; + [_imdmIcon setHidden:FALSE]; + [_imdmLabel setHidden:FALSE]; + } else { + [_imdmIcon setHidden:TRUE]; + [_imdmLabel setHidden:TRUE]; + } +} + #pragma mark - Bubble size computing + (CGSize)computeBoundingBox:(NSString *)text size:(CGSize)size font:(UIFont *)font { @@ -277,7 +311,7 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st static const CGFloat CELL_MIN_HEIGHT = 60.0f; static const CGFloat CELL_MIN_WIDTH = 150.0f; static const CGFloat CELL_MESSAGE_X_MARGIN = 78 + 10.0f; -static const CGFloat CELL_MESSAGE_Y_MARGIN = 44; +static const CGFloat CELL_MESSAGE_Y_MARGIN = 52; // 44; static const CGFloat CELL_IMAGE_HEIGHT = 100.0f; static const CGFloat CELL_IMAGE_WIDTH = 100.0f; diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 2acf576e3..5530befac 100644 Binary files a/Resources/en.lproj/Localizable.strings and b/Resources/en.lproj/Localizable.strings differ diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index 3e6a0916a..6e4d4297b 100644 Binary files a/Resources/fr.lproj/Localizable.strings and b/Resources/fr.lproj/Localizable.strings differ diff --git a/submodules/cmake-builder b/submodules/cmake-builder index d96e72cd9..4d7cd40cf 160000 --- a/submodules/cmake-builder +++ b/submodules/cmake-builder @@ -1 +1 @@ -Subproject commit d96e72cd96b1fb120a72bf249571d6b5bfc47319 +Subproject commit 4d7cd40cf218624b0365e5e36efc6040d6a56bc8 diff --git a/submodules/externals/opus b/submodules/externals/opus index 35b371a85..96a78acac 160000 --- a/submodules/externals/opus +++ b/submodules/externals/opus @@ -1 +1 @@ -Subproject commit 35b371a85bf2cf21ab4b12b5475c76a2775b25d1 +Subproject commit 96a78acaca1970c20e9ee7b1dd253b36d8deb56b diff --git a/submodules/linphone b/submodules/linphone index 2c95a97bc..74ce5cb5f 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 2c95a97bce9584a2d44ffa04b56bb2092161909f +Subproject commit 74ce5cb5f5e91d7e92bffa36ec559984e95b7fdf