Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norstbox
gajim
Commits
4cbc0666
Commit
4cbc0666
authored
Mar 15, 2006
by
Yann Leboulanger
Browse files
show an error dialog when a transport answers wrongly to register request. Fixes #1702
parent
721acff7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/common/connection.py
View file @
4cbc0666
...
...
@@ -1674,6 +1674,11 @@ class Connection:
if
realm
==
common
.
xmpp
.
NS_REGISTER
:
if
event
==
common
.
xmpp
.
features_nb
.
REGISTER_DATA_RECEIVED
:
# data is (agent, DataFrom, is_form)
if
not
data
[
1
]:
# wrong answer
self
.
dispatch
(
'ERROR'
,
(
_
(
'Invalid answer'
),
_
(
'Transport %s answered wrongly to register request.'
)
%
\
data
[
0
]))
return
if
self
.
new_account_info
and
\
self
.
new_account_info
[
'hostname'
]
==
data
[
0
]:
#it's a new account
...
...
src/common/xmpp/features_nb.py
View file @
4cbc0666
...
...
@@ -119,7 +119,11 @@ def _ReceivedRegInfo(con, resp, agent):
iq
=
Iq
(
'get'
,
NS_REGISTER
,
to
=
agent
)
if
not
isResultNode
(
resp
):
return
df
=
resp
.
getTag
(
'query'
,
namespace
=
NS_REGISTER
).
getTag
(
'x'
,
namespace
=
NS_DATA
)
tag
=
resp
.
getTag
(
'query'
,
namespace
=
NS_REGISTER
)
if
not
tag
:
con
.
Event
(
NS_REGISTER
,
REGISTER_DATA_RECEIVED
,(
agent
,
None
,
False
))
return
df
=
tag
.
getTag
(
'x'
,
namespace
=
NS_DATA
)
if
df
:
con
.
Event
(
NS_REGISTER
,
REGISTER_DATA_RECEIVED
,(
agent
,
DataForm
(
node
=
df
),
True
))
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment