From 9c2a0c1e95e4279ad46eba8d176eaf7547df29a2 Mon Sep 17 00:00:00 2001 From: Beqa Gozalishvili Date: Sat, 30 Dec 2023 05:59:58 +0400 Subject: [PATCH] UserRight fix (#111) --- bot/TeamTalk/structs.py | 57 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/bot/TeamTalk/structs.py b/bot/TeamTalk/structs.py index d974e0c..fc6caeb 100644 --- a/bot/TeamTalk/structs.py +++ b/bot/TeamTalk/structs.py @@ -174,36 +174,35 @@ class UserRightPre15(Flag): ViewHiddenChannels = TeamTalkPy.UserRight.USERRIGHT_VIEW_HIDDEN_CHANNELS -class UserRight15(Flag): - Null = TeamTalkPy.UserRight.USERRIGHT_NONE - MultiLogin = TeamTalkPy.UserRight.USERRIGHT_MULTI_LOGIN - ViewAllUsers = TeamTalkPy.UserRight.USERRIGHT_VIEW_ALL_USERS - CreateTemporaryChannel = TeamTalkPy.UserRight.USERRIGHT_CREATE_TEMPORARY_CHANNEL - ModifyChannels = TeamTalkPy.UserRight.USERRIGHT_MODIFY_CHANNELS - BroadcastTextMessage = TeamTalkPy.UserRight.USERRIGHT_TEXTMESSAGE_BROADCAST - KickUsers = TeamTalkPy.UserRight.USERRIGHT_KICK_USERS - BanUsers = TeamTalkPy.UserRight.USERRIGHT_BAN_USERS - MoveUsers = TeamTalkPy.UserRight.USERRIGHT_MOVE_USERS - OperatorEnable = TeamTalkPy.UserRight.USERRIGHT_OPERATOR_ENABLE - UploadFiles = TeamTalkPy.UserRight.USERRIGHT_UPLOAD_FILES - DownloadFiles = TeamTalkPy.UserRight.USERRIGHT_DOWNLOAD_FILES - UpdateServerProperties = TeamTalkPy.UserRight.USERRIGHT_UPDATE_SERVERPROPERTIES - TransmitVoice = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_VOICE - TransmitVideoCapture = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_VIDEOCAPTURE - TransmitDesktop = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_DESKTOP - TransmitDesktopInput = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_DESKTOPINPUT - TransmitMediaFileAudio = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_AUDIO - TransmitMediaFileVideo = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_VIDEO - TransmitMediaFile = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_MEDIAFILE - LockedNickname = TeamTalkPy.UserRight.USERRIGHT_LOCKED_NICKNAME - LockedStatus = TeamTalkPy.UserRight.USERRIGHT_LOCKED_STATUS - RecordVoice = TeamTalkPy.UserRight.USERRIGHT_RECORD_VOICE - ViewHiddenChannels = TeamTalkPy.UserRight.USERRIGHT_VIEW_HIDDEN_CHANNELS - textMessageUser = TeamTalkPy.UserRight.USERRIGHT_TEXTMESSAGE_USER - textMessageChannel = TeamTalkPy.UserRight.USERRIGHT_TEXTMESSAGE_CHANNEL - - if major == "5" and minor >= "15": + class UserRight15(Flag): + Null = TeamTalkPy.UserRight.USERRIGHT_NONE + MultiLogin = TeamTalkPy.UserRight.USERRIGHT_MULTI_LOGIN + ViewAllUsers = TeamTalkPy.UserRight.USERRIGHT_VIEW_ALL_USERS + CreateTemporaryChannel = TeamTalkPy.UserRight.USERRIGHT_CREATE_TEMPORARY_CHANNEL + ModifyChannels = TeamTalkPy.UserRight.USERRIGHT_MODIFY_CHANNELS + BroadcastTextMessage = TeamTalkPy.UserRight.USERRIGHT_TEXTMESSAGE_BROADCAST + KickUsers = TeamTalkPy.UserRight.USERRIGHT_KICK_USERS + BanUsers = TeamTalkPy.UserRight.USERRIGHT_BAN_USERS + MoveUsers = TeamTalkPy.UserRight.USERRIGHT_MOVE_USERS + OperatorEnable = TeamTalkPy.UserRight.USERRIGHT_OPERATOR_ENABLE + UploadFiles = TeamTalkPy.UserRight.USERRIGHT_UPLOAD_FILES + DownloadFiles = TeamTalkPy.UserRight.USERRIGHT_DOWNLOAD_FILES + UpdateServerProperties = TeamTalkPy.UserRight.USERRIGHT_UPDATE_SERVERPROPERTIES + TransmitVoice = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_VOICE + TransmitVideoCapture = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_VIDEOCAPTURE + TransmitDesktop = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_DESKTOP + TransmitDesktopInput = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_DESKTOPINPUT + TransmitMediaFileAudio = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_AUDIO + TransmitMediaFileVideo = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_VIDEO + TransmitMediaFile = TeamTalkPy.UserRight.USERRIGHT_TRANSMIT_MEDIAFILE + LockedNickname = TeamTalkPy.UserRight.USERRIGHT_LOCKED_NICKNAME + LockedStatus = TeamTalkPy.UserRight.USERRIGHT_LOCKED_STATUS + RecordVoice = TeamTalkPy.UserRight.USERRIGHT_RECORD_VOICE + ViewHiddenChannels = TeamTalkPy.UserRight.USERRIGHT_VIEW_HIDDEN_CHANNELS + textMessageUser = TeamTalkPy.UserRight.USERRIGHT_TEXTMESSAGE_USER + textMessageChannel = TeamTalkPy.UserRight.USERRIGHT_TEXTMESSAGE_CHANNEL + UserRight = UserRight15 else: UserRight = UserRightPre15