1
0
mirror of https://github.com/azlux/pymumble synced 2024-11-23 22:06:10 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
790a5262b0
Listening channel support
Merge pull request #120 from Dalrae1/pymumble_py3
2021-11-23 10:55:19 +01:00
Dalrae1
58ccdcc146
Listening channel support 2021-11-22 18:25:46 -08:00
2 changed files with 20 additions and 0 deletions

View File

@ -695,6 +695,10 @@ class Mumble(threading.Thread):
userstate.user_id = cmd.parameters["user_id"] userstate.user_id = cmd.parameters["user_id"]
if "plugin_context" in cmd.parameters: if "plugin_context" in cmd.parameters:
userstate.plugin_context = cmd.parameters["plugin_context"] userstate.plugin_context = cmd.parameters["plugin_context"]
if "listening_channel_add" in cmd.parameters:
userstate.listening_channel_add.extend(cmd.parameters["listening_channel_add"])
if "listening_channel_remove" in cmd.parameters:
userstate.listening_channel_remove.extend(cmd.parameters["listening_channel_remove"])
self.send_message(PYMUMBLE_MSG_TYPES_USERSTATE, userstate) self.send_message(PYMUMBLE_MSG_TYPES_USERSTATE, userstate)
cmd.response = True cmd.response = True

View File

@ -265,3 +265,19 @@ class User(dict):
cmd = messages.RemoveUser(self.mumble_object.users.myself_session, params) cmd = messages.RemoveUser(self.mumble_object.users.myself_session, params)
self.mumble_object.execute_command(cmd) self.mumble_object.execute_command(cmd)
def add_listening_channels(self, channel):
"""Add user to listening channel"""
params = {"session": self["session"],
"listening_channel_add": channel}
cmd = messages.ModUserState(self.mumble_object.users.myself_session, params)
self.mumble_object.execute_command(cmd)
def remove_listening_channels(self, channel):
"""Remove user from listening channel"""
params = {"session": self["session"],
"listening_channel_remove": channel}
cmd = messages.ModUserState(self.mumble_object.users.myself_session, params)
self.mumble_object.execute_command(cmd)