Skip to content

Commit

Permalink
Merge pull request #1762 from nextcloud/dont-ban-federated-user
Browse files Browse the repository at this point in the history
Remove option to ban federated users
  • Loading branch information
SystemKeeper authored Aug 14, 2024
2 parents b29e3b1 + be2fee6 commit b9c9fec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NextcloudTalk/NCRoomParticipant.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern NSString * const NCAttendeeTypeGroup;
extern NSString * const NCAttendeeTypeCircle;
extern NSString * const NCAttendeeTypeGuest;
extern NSString * const NCAttendeeTypeEmail;
extern NSString * const NCAttendeeTypeFederated;

extern NSString * const NCAttendeeBridgeBotId;

Expand Down Expand Up @@ -48,6 +49,7 @@ extern NSString * const NCAttendeeBridgeBotId;
- (BOOL)isGroup;
- (BOOL)isCircle;
- (BOOL)isOffline;
- (BOOL)isFederated;
- (NSString *)detailedName;
- (NSString *)participantId;

Expand Down
6 changes: 6 additions & 0 deletions NextcloudTalk/NCRoomParticipants.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
NSString * const NCAttendeeTypeCircle = @"circles";
NSString * const NCAttendeeTypeGuest = @"guests";
NSString * const NCAttendeeTypeEmail = @"emails";
NSString * const NCAttendeeTypeFederated = @"federated_users";

NSString * const NCAttendeeBridgeBotId = @"bridge-bot";

Expand Down Expand Up @@ -103,6 +104,11 @@ - (BOOL)isCircle
return [_actorType isEqualToString:NCAttendeeTypeCircle];
}

- (BOOL)isFederated
{
return [_actorType isEqualToString:NCAttendeeTypeFederated];
}

- (BOOL)isOffline
{
return ([_sessionId isEqualToString:@"0"] || [_sessionId isEqualToString:@""] || !_sessionId) && _sessionIds.count == 0;
Expand Down
2 changes: 1 addition & 1 deletion NextcloudTalk/RoomInfoTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ - (void)showOptionsForParticipantAtIndexPath:(NSIndexPath *)indexPath
}

if (canParticipantBeModerated) {
if ([[NCDatabaseManager sharedInstance] serverHasTalkCapability:kCapabilityBanV1] && !participant.isGroup && !participant.isCircle) {
if ([[NCDatabaseManager sharedInstance] serverHasTalkCapability:kCapabilityBanV1] && !participant.isGroup && !participant.isCircle && !participant.isFederated) {
NSString *banTitle = NSLocalizedString(@"Ban participant", nil);

UIAlertAction *banParticipant = [UIAlertAction actionWithTitle:banTitle
Expand Down

0 comments on commit b9c9fec

Please sign in to comment.