From 4fabdc42c06a1d8b609969b6e9b7d0471a551e8c Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 4 Jun 2016 23:23:33 +0200 Subject: Make CSI use in the screen plugin configurable And false by default, as it might reduce the user experience in chatrooms. --- plugins/screen_detach.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/screen_detach.py b/plugins/screen_detach.py index 50519871..b51b5c2d 100644 --- a/plugins/screen_detach.py +++ b/plugins/screen_detach.py @@ -18,6 +18,12 @@ Configuration options Try to find and attached tmux. + use_csi + **Default:** ``false`` + + Use `client state indication`_ to limit bandwidth (thus CPU) usage when detached. WARNING: using CSI together with chatrooms will result in inaccurate logs due to presence filtering or other inaccuracies. + +.. _client state indication: https://xmpp.org/extensions/xep-0352.html """ from plugin import BasePlugin @@ -29,7 +35,8 @@ import asyncio DEFAULT_CONFIG = { 'screen_detach': { 'use_tmux': True, - 'use_screen': True + 'use_screen': True, + 'use_csi': False } } @@ -93,10 +100,11 @@ class Plugin(BasePlugin, pyinotify.Notifier): self.attached = attached status = 'available' if self.attached else 'away' self.core.command_status(status) - if self.attached: - self.core.xmpp.plugin['xep_0352'].send_active() - else: - self.core.xmpp.plugin['xep_0352'].send_inactive() + if sef.config.get('use_csi'): + if self.attached: + self.core.xmpp.plugin['xep_0352'].send_active() + else: + self.core.xmpp.plugin['xep_0352'].send_inactive() class HandleScreen(pyinotify.ProcessEvent): def my_init(self, **kwargs): -- cgit v1.2.3