Merge branch 'charlesmchen/trimGroupName'

pull/1/head
Matthew Chen 7 years ago
commit 4814e64c40

@ -467,12 +467,12 @@ NS_ASSUME_NONNULL_BEGIN
- (TSGroupModel *)makeGroup
{
NSString *title = self.groupNameTextField.text;
NSString *groupName =
[self.groupNameTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSMutableArray<NSString *> *recipientIds = [self.memberRecipientIds.allObjects mutableCopy];
[recipientIds addObject:[self.contactsViewHelper localNumber]];
NSData *groupId = [SecurityUtils generateRandomBytes:16];
return [[TSGroupModel alloc] initWithTitle:title memberIds:recipientIds image:self.groupAvatar groupId:groupId];
return [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:self.groupAvatar groupId:groupId];
}
#pragma mark - Group Avatar

@ -170,6 +170,9 @@ NS_ASSUME_NONNULL_BEGIN
- (UIView *)firstSectionHeader
{
OWSAssert(self.thread);
OWSAssert(self.thread.groupModel);
UIView *firstSectionHeader = [UIView new];
firstSectionHeader.backgroundColor = [UIColor whiteColor];
UIView *threadInfoView = [UIView new];
@ -189,16 +192,13 @@ NS_ASSUME_NONNULL_BEGIN
[avatarView autoPinEdgeToSuperviewEdge:ALEdgeLeft];
[avatarView autoSetDimension:ALDimensionWidth toSize:kAvatarSize];
[avatarView autoSetDimension:ALDimensionHeight toSize:kAvatarSize];
if (self.thread.groupModel) {
_groupAvatar = self.thread.groupModel.groupImage;
}
_groupAvatar = self.thread.groupModel.groupImage;
[self updateAvatarView];
UITextField *groupNameTextField = [UITextField new];
_groupNameTextField = groupNameTextField;
if (self.thread) {
self.groupNameTextField.text = self.thread.groupModel.groupName;
}
self.groupNameTextField.text =
[self.thread.groupModel.groupName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
groupNameTextField.textColor = [UIColor blackColor];
groupNameTextField.font = [UIFont ows_dynamicTypeTitle2Font];
groupNameTextField.placeholder
@ -373,7 +373,9 @@ NS_ASSUME_NONNULL_BEGIN
{
OWSAssert(self.conversationSettingsViewDelegate);
TSGroupModel *groupModel = [[TSGroupModel alloc] initWithTitle:self.groupNameTextField.text
NSString *groupName =
[self.groupNameTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
TSGroupModel *groupModel = [[TSGroupModel alloc] initWithTitle:groupName
memberIds:[self.memberRecipientIds.allObjects mutableCopy]
image:self.groupAvatar
groupId:self.thread.groupModel.groupId];

Loading…
Cancel
Save