summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-14 19:39:01 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-14 19:39:01 +0100
commit769bc6d3bf9ea28fd20a7ed628e1256ac76c2d58 (patch)
treec2ff248b9d4e92bfbee006e280a9caa58dbf03c5
parent084d6cb5d9cd017a084c4a2b30741ccf5180de98 (diff)
downloadslixmpp-769bc6d3bf9ea28fd20a7ed628e1256ac76c2d58.tar.gz
slixmpp-769bc6d3bf9ea28fd20a7ed628e1256ac76c2d58.tar.bz2
slixmpp-769bc6d3bf9ea28fd20a7ed628e1256ac76c2d58.tar.xz
slixmpp-769bc6d3bf9ea28fd20a7ed628e1256ac76c2d58.zip
session: Also fire the session_start event.
-rw-r--r--slixmpp/features/feature_session/session.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/slixmpp/features/feature_session/session.py b/slixmpp/features/feature_session/session.py
index b525d50c..e0e69e87 100644
--- a/slixmpp/features/feature_session/session.py
+++ b/slixmpp/features/feature_session/session.py
@@ -43,11 +43,15 @@ class FeatureSession(BasePlugin):
Arguments:
feature -- The stream features element.
"""
- if not features['session']['optional']:
- iq = self.xmpp.Iq()
- iq['type'] = 'set'
- iq.enable('session')
- yield from iq.send(callback=self._on_start_session_response)
+ if features['session']['optional']:
+ self.xmpp.sessionstarted = True
+ self.xmpp.event('session_start')
+ return
+
+ iq = self.xmpp.Iq()
+ iq['type'] = 'set'
+ iq.enable('session')
+ yield from iq.send(callback=self._on_start_session_response)
def _on_start_session_response(self, response):
self.xmpp.features.add('session')