2025-08-29 18:15:35 +08:00
|
|
|
|
//
|
|
|
|
|
// XPRoomSettingAction.m
|
|
|
|
|
// YuMi
|
|
|
|
|
//
|
|
|
|
|
// Created by Linus on 2025/1/13.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "XPRoomSettingAction.h"
|
2025-09-01 18:55:46 +08:00
|
|
|
|
#import "XPRoomMoreMenuActionContext.h"
|
2025-08-29 18:15:35 +08:00
|
|
|
|
#import "XPRoomSettingViewController.h"
|
|
|
|
|
|
|
|
|
|
@implementation XPRoomSettingAction
|
|
|
|
|
|
|
|
|
|
+ (instancetype)action {
|
|
|
|
|
XPRoomSettingAction *action = [[XPRoomSettingAction alloc] init];
|
2025-09-01 18:55:46 +08:00
|
|
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter21");
|
|
|
|
|
action.imageName = @"room_more_menu_setting";
|
2025-08-29 18:15:35 +08:00
|
|
|
|
action.type = RoomMoreMenuType_Room_Setting;
|
|
|
|
|
action.isEnabled = YES;
|
2025-09-01 18:55:46 +08:00
|
|
|
|
action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor];
|
2025-08-29 18:15:35 +08:00
|
|
|
|
return action;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL)canExecuteWithContext:(XPRoomMoreMenuActionContext *)context {
|
2025-09-01 14:29:21 +08:00
|
|
|
|
// 房间设置只有房主或管理员可以操作
|
|
|
|
|
// 这里需要根据用户身份判断,暂时返回 YES
|
2025-08-29 18:15:35 +08:00
|
|
|
|
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
|