try to make settings for group chat working

pull/78/head
Ryan ZHAO 5 years ago
parent 1b6828888f
commit b29096ad21

@ -134,7 +134,6 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableThreadSanitizer = "YES"
enableUBSanitizer = "YES" enableUBSanitizer = "YES"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"

@ -7,7 +7,7 @@
<key>CarthageVersion</key> <key>CarthageVersion</key>
<string>0.34.0</string> <string>0.34.0</string>
<key>OSXVersion</key> <key>OSXVersion</key>
<string>10.15.1</string> <string>10.15.2</string>
<key>WebRTCCommit</key> <key>WebRTCCommit</key>
<string>1445d719bf05280270e9f77576f80f973fd847f8 M73</string> <string>1445d719bf05280270e9f77576f80f973fd847f8 M73</string>
</dict> </dict>

@ -89,6 +89,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)commonInit - (void)commonInit
{ {
_groupId = [Randomness generateRandomBytes:kGroupIdLength]; _groupId = [Randomness generateRandomBytes:kGroupIdLength];
_groupType = SIGNAL;
_messageSender = SSKEnvironment.shared.messageSender; _messageSender = SSKEnvironment.shared.messageSender;
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self]; _contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];

@ -185,6 +185,17 @@ const CGFloat kIconViewLength = 24;
return [self.thread isKindOfClass:[TSGroupThread class]]; return [self.thread isKindOfClass:[TSGroupThread class]];
} }
-(BOOL)isPrivateGroupChat
{
if (self.isGroupThread) {
TSGroupThread *thread = (TSGroupThread*)self.thread;
if (thread.isRSSFeed || thread.isPublicChat) {
return false;
}
}
return true;
}
- (void)configureWithThread:(TSThread *)thread uiDatabaseConnection:(YapDatabaseConnection *)uiDatabaseConnection - (void)configureWithThread:(TSThread *)thread uiDatabaseConnection:(YapDatabaseConnection *)uiDatabaseConnection
{ {
OWSAssertDebug(thread); OWSAssertDebug(thread);
@ -624,8 +635,8 @@ const CGFloat kIconViewLength = 24;
// Group settings section. // Group settings section.
/*
if (self.isGroupThread) { if (self.isGroupThread && self.isPrivateGroupChat) {
NSArray *groupItems = @[ NSArray *groupItems = @[
[OWSTableItem [OWSTableItem
itemWithCustomCellBlock:^{ itemWithCustomCellBlock:^{
@ -676,7 +687,7 @@ const CGFloat kIconViewLength = 24;
@"Conversation settings table section title") @"Conversation settings table section title")
items:groupItems]]; items:groupItems]];
} }
*/
// Mute thread section. // Mute thread section.
@ -1075,8 +1086,10 @@ const CGFloat kIconViewLength = 24;
- (void)showGroupMembersView - (void)showGroupMembersView
{ {
OWSLogInfo(@"Setting show thread");
TSGroupThread *groupThread = (TSGroupThread *)self.thread;
ShowGroupMembersViewController *showGroupMembersViewController = [ShowGroupMembersViewController new]; ShowGroupMembersViewController *showGroupMembersViewController = [ShowGroupMembersViewController new];
[showGroupMembersViewController configWithThread:(TSGroupThread *)self.thread]; [showGroupMembersViewController configWithThread:groupThread];
[self.navigationController pushViewController:showGroupMembersViewController animated:YES]; [self.navigationController pushViewController:showGroupMembersViewController animated:YES];
} }

@ -92,6 +92,8 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssertDebug(self.thread.groupModel.groupMemberIds); OWSAssertDebug(self.thread.groupModel.groupMemberIds);
self.memberRecipientIds = [NSSet setWithArray:self.thread.groupModel.groupMemberIds]; self.memberRecipientIds = [NSSet setWithArray:self.thread.groupModel.groupMemberIds];
OWSLogInfo(@"Setting show thread %@", self.thread.groupModel.groupName);
} }
- (void)viewDidLoad - (void)viewDidLoad
@ -112,6 +114,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)updateTableContents - (void)updateTableContents
{ {
// OWSLogInfo(@"Setting show thread %@", self.thread.groupModel.groupName);
OWSAssertDebug(self.thread); OWSAssertDebug(self.thread);
OWSTableContents *contents = [OWSTableContents new]; OWSTableContents *contents = [OWSTableContents new];

@ -72,6 +72,8 @@ typedef NS_ENUM(NSInteger, LKThreadFriendRequestStatus) {
* @return YES if is a group thread, NO otherwise. * @return YES if is a group thread, NO otherwise.
*/ */
- (BOOL)isGroupThread; - (BOOL)isGroupThread;
//- (BOOL)isPublicChat;
//- (BOOL)isRSSFeed;
/** /**
* Returns the name of the thread. * Returns the name of the thread.

@ -94,6 +94,12 @@ ConversationColorName const kConversationColorName_Default = ConversationColorNa
} }
_friendRequestStatus = LKThreadFriendRequestStatusNone; _friendRequestStatus = LKThreadFriendRequestStatusNone;
// Loki - Friend request logic doesn't apply to group chats, always treat them as friends
if (self.isGroupThread) {
_friendRequestStatus = LKThreadFriendRequestStatusFriends;
}
// OWSLogInfo(@"FRIEND REQUEST STATUS %@", self.friendRequestStatusDescription);
} }
return self; return self;
@ -225,6 +231,20 @@ ConversationColorName const kConversationColorName_Default = ConversationColorNa
return NO; return NO;
} }
//- (BOOL)isPublicChat
//{
// OWSAbstractMethod();
//
// return NO;
//}
//
//- (BOOL)isRSSFeed
//{
// OWSAbstractMethod();
//
// return NO;
//}
// Override in ContactThread // Override in ContactThread
- (nullable NSString *)contactIdentifier - (nullable NSString *)contactIdentifier
{ {

@ -17,6 +17,7 @@ extern NSString *const TSGroupThread_NotificationKey_UniqueId;
@property (nonatomic, strong) TSGroupModel *groupModel; @property (nonatomic, strong) TSGroupModel *groupModel;
@property (nonatomic, readonly) BOOL isRSSFeed; @property (nonatomic, readonly) BOOL isRSSFeed;
@property (nonatomic, readonly) BOOL isPublicChat;
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel; + (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel;
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel + (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel

Loading…
Cancel
Save