Debug
This commit is contained in:
parent
f5786a11fe
commit
4156b0e87e
|
@ -896,9 +896,17 @@ static CGRect oldframe;
|
|||
|
||||
- (void)didTapLeaveGroup
|
||||
{
|
||||
NSString *userPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey;
|
||||
NSString *message;
|
||||
if ([((TSGroupThread *)self.thread).groupModel.groupAdminIds containsObject:userPublicKey]) {
|
||||
message = @"Because you are the creator of this group it will be deleted for everyone. This cannot be undone.";
|
||||
} else {
|
||||
message = NSLocalizedString(@"CONFIRM_LEAVE_GROUP_DESCRIPTION", @"Alert body");
|
||||
}
|
||||
|
||||
UIAlertController *alert =
|
||||
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_TITLE", @"Alert title")
|
||||
message:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_DESCRIPTION", @"Alert body")
|
||||
message:message
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction *leaveAction = [UIAlertAction
|
||||
|
|
|
@ -253,7 +253,7 @@ final class EditClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelega
|
|||
return popToConversationVC(self)
|
||||
}
|
||||
if !members.contains(getUserHexEncodedPublicKey()) {
|
||||
guard members.intersection(Set(thread.groupModel.groupMemberIds).subtracting([ getUserHexEncodedPublicKey() ])) == members else {
|
||||
guard Set(thread.groupModel.groupMemberIds).subtracting([ getUserHexEncodedPublicKey() ]) == members else {
|
||||
return showError(title: "Couldn't Update Group", message: "Can't leave while adding or removing other members.")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -426,13 +426,13 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol
|
|||
let groupPublicKey = LKGroupUtilities.getDecodedGroupID(groupID)
|
||||
do {
|
||||
try MessageSender.leaveV2(groupPublicKey, using: transaction)
|
||||
Storage.write { transaction in
|
||||
thread.removeAllThreadInteractions(with: transaction)
|
||||
thread.remove(with: transaction)
|
||||
}
|
||||
} catch {
|
||||
// TODO: Handle
|
||||
}
|
||||
Storage.write { transaction in
|
||||
thread.removeAllThreadInteractions(with: transaction)
|
||||
thread.remove(with: transaction)
|
||||
}
|
||||
} else {
|
||||
thread.removeAllThreadInteractions(with: transaction)
|
||||
thread.remove(with: transaction)
|
||||
|
|
Loading…
Reference in New Issue