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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
TSRh
gajim
Commits
9985b784
Commit
9985b784
authored
17 years ago
by
Brendan Taylor
Browse files
Options
Downloads
Patches
Plain Diff
bugfixes, send not-acceptable for fields with only unsupported options
parent
e1c4d80e
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
+3
-0
3 additions, 0 deletions
src/common/connection_handlers.py
src/common/stanza_session.py
+17
-13
17 additions, 13 deletions
src/common/stanza_session.py
with
20 additions
and
13 deletions
src/common/connection_handlers.py
+
3
−
0
View file @
9985b784
...
...
@@ -1584,6 +1584,9 @@ def get_session(self, jid, thread_id, type):
if
bare_jid
!=
jid
:
session
=
self
.
find_session
(
bare_jid
,
thread_id
,
type
)
if
session
:
if
not
session
.
received_thread_id
:
thread_id
=
session
.
thread_id
self
.
move_session
(
bare_jid
,
thread_id
,
jid
.
split
(
"
/
"
)[
1
])
return
session
...
...
This diff is collapsed.
Click to expand it.
src/common/stanza_session.py
+
17
−
13
View file @
9985b784
...
...
@@ -48,8 +48,8 @@ def generate_thread_id(self):
return
""
.
join
([
random
.
choice
(
string
.
letters
)
for
x
in
xrange
(
0
,
32
)])
def
send
(
self
,
msg
):
if
self
.
thread_id
and
isinstance
(
msg
,
xmpp
.
Message
)
:
msg
.
setT
hread
(
self
.
thread_id
)
if
self
.
thread_id
:
msg
.
NT
.
t
hread
=
self
.
thread_id
msg
.
setAttr
(
'
to
'
,
self
.
jid
)
self
.
conn
.
send_stanza
(
msg
)
...
...
@@ -530,10 +530,10 @@ def verify_options_bob(self, form):
elif
name
==
'
logging
'
:
my_prefs
=
self
.
logging_preference
()
if
my_prefs
[
0
]
in
options
:
if
my_prefs
[
0
]
in
options
:
# our first choice is offered, select it
pref
=
my_prefs
[
0
]
negotiated
[
'
logging
'
]
=
pref
else
:
else
:
# see if other acceptable choices are offered
for
pref
in
my_prefs
:
if
pref
in
options
:
ask_user
[
'
logging
'
]
=
pref
...
...
@@ -572,7 +572,9 @@ def respond_e2e_bob(self, form, negotiated, not_acceptable):
x
.
addChild
(
node
=
xmpp
.
DataField
(
name
=
'
accept
'
,
value
=
'
true
'
))
for
name
in
negotiated
:
x
.
addChild
(
node
=
xmpp
.
DataField
(
name
=
name
,
value
=
negotiated
[
name
]))
# some fields are internal and should not be sent
if
not
name
in
(
'
send_pubkey
'
,
'
recv_pubkey
'
):
x
.
addChild
(
node
=
xmpp
.
DataField
(
name
=
name
,
value
=
negotiated
[
name
]))
self
.
negotiated
=
negotiated
...
...
@@ -616,14 +618,16 @@ def respond_e2e_bob(self, form, negotiated, not_acceptable):
feature
.
addChild
(
node
=
x
)
if
not_acceptable
:
pass
# XXX
# <error code='406' type='modify'>
# <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
# <feature xmlns='http://jabber.org/protocol/feature-neg'>
# <field var='security'/>
# </feature>
# </error>
response
=
xmpp
.
Error
(
response
,
xmpp
.
ERR_NOT_ACCEPTABLE
)
feature
=
xmpp
.
Node
(
xmpp
.
NS_FEATURE
+
'
feature
'
)
for
f
in
not_acceptable
:
n
=
xmpp
.
Node
(
'
field
'
)
n
[
'
var
'
]
=
f
feature
.
addChild
(
node
=
n
)
response
.
T
.
error
.
addChild
(
node
=
feature
)
self
.
send
(
response
)
...
...
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