diff options
Diffstat (limited to 'sleekxmpp/plugins/xep_0199/ping.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0199/ping.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sleekxmpp/plugins/xep_0199/ping.py b/sleekxmpp/plugins/xep_0199/ping.py index a0f60532..851e5ae5 100644 --- a/sleekxmpp/plugins/xep_0199/ping.py +++ b/sleekxmpp/plugins/xep_0199/ping.py @@ -15,14 +15,14 @@ from sleekxmpp.exceptions import IqError, IqTimeout from sleekxmpp.xmlstream import register_stanza_plugin from sleekxmpp.xmlstream.matcher import StanzaPath from sleekxmpp.xmlstream.handler import Callback -from sleekxmpp.plugins.base import base_plugin +from sleekxmpp.plugins import BasePlugin from sleekxmpp.plugins.xep_0199 import stanza, Ping log = logging.getLogger(__name__) -class xep_0199(base_plugin): +class XEP_0199(BasePlugin): """ XEP-0199: XMPP Ping @@ -47,14 +47,15 @@ class xep_0199(base_plugin): round trip time. """ + name = 'xep_0199' + description = 'XEP-0199: XMPP Ping' + dependencies = set(['xep_0030']) + stanza = stanza + def plugin_init(self): """ Start the XEP-0199 plugin. """ - self.description = 'XMPP Ping' - self.xep = '0199' - self.stanza = stanza - self.keepalive = self.config.get('keepalive', False) self.frequency = float(self.config.get('frequency', 300)) self.timeout = self.config.get('timeout', 30) @@ -73,9 +74,6 @@ class xep_0199(base_plugin): self.xmpp.add_event_handler('session_end', self._handle_session_end) - def post_init(self): - """Handle cross-plugin dependencies.""" - base_plugin.post_init(self) self.xmpp['xep_0030'].add_feature(Ping.namespace) def _handle_keepalive(self, event): @@ -169,7 +167,3 @@ class xep_0199(base_plugin): log.debug("Pong: %s %f", jid, delay) return delay - - -# Backwards compatibility for names -xep_0199.sendPing = xep_0199.send_ping |