Minor reimplementation the /audio and /video commands

This commit is contained in:
Alexander Cherniuk 2010-08-07 17:37:14 +03:00
parent d9c7fca2de
commit 2d23b938b7

View file

@ -198,22 +198,20 @@ class StandardCommonChatCommands(CommandContainer):
def audio(self): def audio(self):
if not self.audio_available: if not self.audio_available:
raise CommandError(_("Audio sessions are not available")) raise CommandError(_("Audio sessions are not available"))
else: # An audio session is toggled by inverting the state of the
# A state of an audio session is toggled by inverting a state of the # appropriate button.
# appropriate button. state = self._audio_button.get_active()
state = self._audio_button.get_active() self._audio_button.set_active(not state)
self._audio_button.set_active(not state)
@command @command
@doc(_("Toggle video session")) @doc(_("Toggle video session"))
def video(self): def video(self):
if not self.video_available: if not self.video_available:
raise CommandError(_("Video sessions are not available")) raise CommandError(_("Video sessions are not available"))
else: # A video session is toggled by inverting the state of the
# A state of a video session is toggled by inverting a state of the # appropriate button.
# appropriate button. state = self._video_button.get_active()
state = self._video_button.get_active() self._video_button.set_active(not state)
self._video_button.set_active(not state)
class StandardChatCommands(CommandContainer): class StandardChatCommands(CommandContainer):
""" """