summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-06-04 23:23:33 +0200
committermathieui <mathieui@mathieui.net>2016-06-04 23:23:33 +0200
commit4fabdc42c06a1d8b609969b6e9b7d0471a551e8c (patch)
tree15f0bbdfd3c70c74c4811213059c4675ce1c771d /plugins
parent46d3da365c7691a6c8d079befeacb4b86c6ae62c (diff)
downloadpoezio-4fabdc42c06a1d8b609969b6e9b7d0471a551e8c.tar.gz
poezio-4fabdc42c06a1d8b609969b6e9b7d0471a551e8c.tar.bz2
poezio-4fabdc42c06a1d8b609969b6e9b7d0471a551e8c.tar.xz
poezio-4fabdc42c06a1d8b609969b6e9b7d0471a551e8c.zip
Make CSI use in the screen plugin configurable
And false by default, as it might reduce the user experience in chatrooms.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/screen_detach.py18
1 files changed, 13 insertions, 5 deletions
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):