mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-05 15:37:45 +02:00
Room Members: Add Admin/Moderator badge on members's picture
This commit is contained in:
@@ -590,6 +590,8 @@
|
||||
participantCell.accessoryView = nil;
|
||||
participantCell.contentView.alpha = 1;
|
||||
participantCell.userInteractionEnabled = YES;
|
||||
|
||||
participantCell.thumbnailBadgeView.hidden = YES;
|
||||
}
|
||||
|
||||
participantCell.mxRoom = self.mxRoom;
|
||||
@@ -683,6 +685,22 @@
|
||||
participantCell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"plus_icon"]];
|
||||
}
|
||||
}
|
||||
else if (contact.mxMember)
|
||||
{
|
||||
// Update member badge
|
||||
MXRoomPowerLevels *powerLevels = [self.mxRoom.state powerLevels];
|
||||
NSInteger powerLevel = [powerLevels powerLevelOfUserWithUserID:contact.mxMember.userId];
|
||||
if (powerLevel >= kVectorRoomAdminLevel)
|
||||
{
|
||||
participantCell.thumbnailBadgeView.image = [UIImage imageNamed:@"admin_icon_small"];
|
||||
participantCell.thumbnailBadgeView.hidden = NO;
|
||||
}
|
||||
else if (powerLevel >= kVectorRoomModeratorLevel)
|
||||
{
|
||||
participantCell.thumbnailBadgeView.image = [UIImage imageNamed:@"mod_icon_small"];
|
||||
participantCell.thumbnailBadgeView.hidden = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return participantCell;
|
||||
|
||||
Reference in New Issue
Block a user