diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.h b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.h index 1b499ec73..9bc2f5a94 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.h +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.h @@ -36,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic) id textViewToolbarDelegate; - (NSString *)trimmedText; +- (void)setPlaceholderText:(NSString *)placeholderText; @end diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m index 850612c31..fbb12624b 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN self.text = nil; self.placeholderView = [UILabel new]; - self.placeholderView.text = NSLocalizedString(@"new_message", @""); + self.placeholderView.text = NSLocalizedString(@"New Message", @""); self.placeholderView.textColor = Theme.placeholderColor; self.placeholderView.userInteractionEnabled = NO; [self addSubview:self.placeholderView]; @@ -176,6 +176,11 @@ NS_ASSUME_NONNULL_BEGIN return [self.text ows_stripped]; } +- (void)setPlaceholderText:(NSString *)placeholderText +{ + [self.placeholderView setText:placeholderText]; +} + #pragma mark - UITextViewDelegate - (void)textViewDidChange:(UITextView *)textView diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h index 197fc18ff..cf94f19c3 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h @@ -51,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN - (NSString *)messageText; - (void)setMessageText:(NSString *_Nullable)value animated:(BOOL)isAnimated; +- (void)setPlaceholderText:(NSString *)placeholderText; - (void)clearTextMessageAnimated:(BOOL)isAnimated; - (void)toggleDefaultKeyboard; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index 95155cd84..d2da6ef54 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -313,6 +313,11 @@ const CGFloat kMaxTextViewHeight = 98; [self ensureShouldShowVoiceMemoButtonAnimated:isAnimated doLayout:YES]; } +- (void)setPlaceholderText:(NSString *)placeholderText +{ + [self.inputTextView setPlaceholderText:placeholderText]; +} + - (void)ensureTextViewHeight { [self updateHeightWithTextView:self.inputTextView]; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 5c0dbde11..7a1296c0e 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -627,6 +627,7 @@ typedef enum : NSUInteger { self.inputToolbar.inputToolbarDelegate = self; self.inputToolbar.inputTextViewDelegate = self; SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _inputToolbar); + [self updateInputToolbar]; self.loadMoreHeader = [UILabel new]; self.loadMoreHeader.text = NSLocalizedString(@"CONVERSATION_VIEW_LOADING_MORE_MESSAGES", @@ -1584,11 +1585,13 @@ typedef enum : NSUInteger { #pragma mark - Updating -- (void)updateIsInputToolbarInteractionEnabled { +- (void)updateInputToolbar { TSThreadFriendRequestStatus friendRequestStatus = [self.thread getFriendRequestStatus]; BOOL isFriendRequest = friendRequestStatus == TSThreadFriendRequestStatusPendingSend || friendRequestStatus == TSThreadFriendRequestStatusRequestSent || friendRequestStatus == TSThreadFriendRequestStatusRequestReceived; [self.inputToolbar setUserInteractionEnabled:!isFriendRequest]; + NSString *placeholderText = isFriendRequest ? NSLocalizedString(@"Pending Friend Request...", "") : NSLocalizedString(@"New Message", ""); + [self.inputToolbar setPlaceholderText:placeholderText]; } #pragma mark - Identity @@ -4891,7 +4894,7 @@ typedef enum : NSUInteger { [self updateBackButtonUnreadCount]; [self updateNavigationBarSubtitleLabel]; [self dismissMenuActionsIfNecessary]; - [self updateIsInputToolbarInteractionEnabled]; + [self updateInputToolbar]; if (self.isGroupConversation) { [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 7a3787bfc..adc3ef670 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -2574,3 +2574,5 @@ "%@ sent you a friend request" = "%@ sent you a friend request"; "Accept" = "Accept"; "Decline" = "Decline"; +"Pending Friend Request..." = "Pending Friend Request..."; +"New Message" = "New Message";