// // XPRoomSettingAction.m // YuMi // // Created by Linus on 2025/1/13. // #import "XPRoomSettingAction.h" #import "XPRoomMoreMenuActionContext.h" #import "XPRoomSettingViewController.h" @implementation XPRoomSettingAction + (instancetype)action { XPRoomSettingAction *action = [[XPRoomSettingAction alloc] init]; action.title = YMLocalizedString(@"XPMoreMenuPresenter21"); action.imageName = @"room_more_menu_setting"; action.type = RoomMoreMenuType_Room_Setting; action.isEnabled = YES; action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; return action; } - (BOOL)canExecuteWithContext:(XPRoomMoreMenuActionContext *)context { // 房间设置只有房主或管理员可以操作 // 这里需要根据用户身份判断,暂时返回 YES return self.isEnabled; } - (void)executeWithContext:(XPRoomMoreMenuActionContext *)context { // 关闭当前页面 [context.presentingViewController dismissViewControllerAnimated:YES completion:nil]; // 创建并跳转到房间设置页面 XPRoomSettingViewController *roomSettingVC = [[XPRoomSettingViewController alloc] initWithDelegate:context.hostDelegate]; [context.hostDelegate.getCurrentNav pushViewController:roomSettingVC animated:YES]; } @end