Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
df5200b3
Commit
df5200b3
authored
16 years ago
by
Brendan Taylor
Browse files
Options
Downloads
Patches
Plain Diff
try not to send session termination messages to non-XEP-0201 clients
parent
f7874d29
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/connection_handlers.py
+2
-0
2 additions, 0 deletions
src/common/connection_handlers.py
src/common/stanza_session.py
+11
-8
11 additions, 8 deletions
src/common/stanza_session.py
with
13 additions
and
8 deletions
src/common/connection_handlers.py
+
2
−
0
View file @
df5200b3
...
...
@@ -1752,6 +1752,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
if
thread_id
and
not
session
.
received_thread_id
:
session
.
received_thread_id
=
True
session
.
last_receive
=
time_time
()
# check if the message is a XEP-0020 feature negotiation request
if
msg
.
getTag
(
'
feature
'
,
namespace
=
common
.
xmpp
.
NS_FEATURE
):
if
gajim
.
HAVE_PYCRYPTO
:
...
...
This diff is collapsed.
Click to expand it.
src/common/stanza_session.py
+
11
−
8
View file @
df5200b3
...
...
@@ -35,6 +35,7 @@ class StanzaSession(object):
self
.
loggable
=
True
self
.
last_send
=
0
self
.
last_receive
=
0
self
.
status
=
None
self
.
negotiated
=
{}
...
...
@@ -110,17 +111,19 @@ class StanzaSession(object):
self
.
negotiated
=
{}
def
terminate
(
self
):
msg
=
xmpp
.
Message
()
feature
=
msg
.
NT
.
feature
feature
.
setNamespace
(
xmpp
.
NS_FEATURE
)
# only send termination message if we think they might have XEP-0201 support
if
self
.
received_thread_id
or
self
.
last_receive
==
0
:
msg
=
xmpp
.
Message
()
feature
=
msg
.
NT
.
feature
feature
.
setNamespace
(
xmpp
.
NS_FEATURE
)
x
=
xmpp
.
DataForm
(
typ
=
'
submit
'
)
x
.
addChild
(
node
=
xmpp
.
DataField
(
name
=
'
FORM_TYPE
'
,
value
=
'
urn:xmpp:ssn
'
))
x
.
addChild
(
node
=
xmpp
.
DataField
(
name
=
'
terminate
'
,
value
=
'
1
'
))
x
=
xmpp
.
DataForm
(
typ
=
'
submit
'
)
x
.
addChild
(
node
=
xmpp
.
DataField
(
name
=
'
FORM_TYPE
'
,
value
=
'
urn:xmpp:ssn
'
))
x
.
addChild
(
node
=
xmpp
.
DataField
(
name
=
'
terminate
'
,
value
=
'
1
'
))
feature
.
addChild
(
node
=
x
)
feature
.
addChild
(
node
=
x
)
self
.
send
(
msg
)
self
.
send
(
msg
)
self
.
status
=
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment