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
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
Peter Shkenev
gajim
Commits
d82dab9f
Commit
d82dab9f
authored
19 years ago
by
dkirov
Browse files
Options
Downloads
Patches
Plain Diff
handle socks5 error replies
parent
0a0eaa60
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gajim.py
+55
-11
55 additions, 11 deletions
src/gajim.py
with
55 additions
and
11 deletions
src/gajim.py
+
55
−
11
View file @
d82dab9f
...
...
@@ -211,14 +211,26 @@ def handle_event_error_answer(self, account, array):
id
,
jid_from
,
errmsg
,
errcode
=
array
if
str
(
errcode
)
in
[
'
403
'
,
'
406
'
]
and
id
:
ft
=
self
.
windows
[
'
file_transfers
'
]
if
ft
.
files_props
[
'
s
'
].
has_key
(
id
):
file_props
=
ft
.
files_props
[
'
s
'
][
id
]
file_props
[
'
error
'
]
=
-
1
if
file_props
.
has_key
(
'
disconnect_cb
'
)
and
\
file_props
[
'
disconnect_cb
'
]
is
not
None
:
file_props
[
'
disconnect_cb
'
]()
self
.
handle_event_file_rcv_completed
(
account
,
file_props
)
return
# show the error dialog
elif
str
(
errcode
)
==
'
404
'
:
conn
=
gajim
.
connections
[
account
]
sid
=
id
[
3
:]
if
conn
.
files_props
.
has_key
(
sid
):
file_props
=
conn
.
files_props
[
sid
]
if
file_props
.
has_key
(
'
streamhosts
'
):
streamhosts
=
file_props
[
'
streamhosts
'
]
gajim
.
socks5queue
.
add_file_props
(
account
,
file_props
)
gajim
.
socks5queue
.
connect_to_hosts
(
account
,
sid
,
conn
.
send_success_connect_reply
,
None
)
if
file_props
.
has_key
(
'
fast
'
):
streamhosts
=
file_props
[
'
fast
'
]
file_props
[
'
streamhosts
'
]
=
streamhosts
gajim
.
socks5queue
.
add_file_props
(
account
,
file_props
)
gajim
.
socks5queue
.
connect_to_hosts
(
account
,
sid
,
conn
.
send_success_connect_reply
,
None
)
return
#('ERROR_ANSWER', account, (id, jid_from. errmsg, errcode))
if
jid_from
in
self
.
windows
[
account
][
'
gc
'
]:
self
.
windows
[
account
][
'
gc
'
][
jid_from
].
print_conversation
(
...
...
@@ -712,14 +724,42 @@ def handle_event_roster_info(self, account, array):
def
handle_event_bookmarks
(
self
,
account
,
bms
):
#('BOOKMARKS', account, [{name,jid,autojoin,password,nick}, {}])
#We received a bookmark item from the server (JEP48)
#Auto join GC windows if neccessary
for
bm
in
bms
:
if
bm
[
'
autojoin
'
]
==
'
1
'
:
self
.
roster
.
join_gc_room
(
account
,
bm
[
'
jid
'
],
bm
[
'
nick
'
],
bm
[
'
password
'
])
self
.
roster
.
make_menu
()
def
handle_event_file_send_error
(
self
,
account
,
array
):
jid
=
array
[
0
]
file_props
=
array
[
1
]
self
.
windows
[
'
file_transfers
'
].
show_file_error
(
account
,
contact
,
file_props
)
if
gajim
.
config
.
get
(
'
notify_on_new_message
'
):
# check if we should be notified
instance
=
dialogs
.
PopupNotificationWindow
(
self
,
_
(
'
File Transfer Error
'
),
jid
,
account
,
'
file-error
'
,
file_props
)
self
.
roster
.
popup_notification_windows
.
append
(
instance
)
elif
(
gajim
.
connections
[
account
].
connected
in
(
2
,
3
)
and
gajim
.
config
.
get
(
'
autopopup
'
))
or
\
gajim
.
config
.
get
(
'
autopopupaway
'
):
contact
=
gajim
.
contacts
[
account
][
jid
][
0
]
self
.
windows
[
'
file_transfers
'
].
show_send_error
(
file_props
)
def
handle_event_file_request_error
(
self
,
account
,
array
):
jid
=
array
[
0
]
file_props
=
array
[
1
]
if
gajim
.
config
.
get
(
'
notify_on_new_message
'
):
# check if we should be notified
instance
=
dialogs
.
PopupNotificationWindow
(
self
,
_
(
'
File Transfer Error
'
),
jid
,
account
,
'
file-error
'
,
file_props
)
self
.
roster
.
popup_notification_windows
.
append
(
instance
)
elif
(
gajim
.
connections
[
account
].
connected
in
(
2
,
3
)
and
gajim
.
config
.
get
(
'
autopopup
'
))
or
\
gajim
.
config
.
get
(
'
autopopupaway
'
):
self
.
windows
[
'
file_transfers
'
].
show_request_error
(
file_props
)
def
handle_event_file_request
(
self
,
account
,
array
):
jid
=
array
[
0
]
if
not
gajim
.
contacts
[
account
].
has_key
(
jid
):
...
...
@@ -734,7 +774,7 @@ def handle_event_file_request(self, account, array):
and
gajim
.
config
.
get
(
'
autopopup
'
))
or
\
gajim
.
config
.
get
(
'
autopopupaway
'
):
contact
=
gajim
.
contacts
[
account
][
jid
][
0
]
self
.
windows
[
'
file_transfers
'
].
show_
file
_request
(
self
.
windows
[
'
file_transfers
'
].
show_
send
_request
(
account
,
contact
,
file_props
)
def
handle_event_file_progress
(
self
,
account
,
file_props
):
...
...
@@ -947,6 +987,10 @@ def register_handlers(self, con):
con
.
register_handler
(
'
BOOKMARKS
'
,
self
.
handle_event_bookmarks
)
con
.
register_handler
(
'
CON_TYPE
'
,
self
.
handle_event_con_type
)
con
.
register_handler
(
'
FILE_REQUEST
'
,
self
.
handle_event_file_request
)
con
.
register_handler
(
'
FILE_REQUEST_ERROR
'
,
\
self
.
handle_event_file_request_error
)
con
.
register_handler
(
'
FILE_SEND_ERROR
'
,
\
self
.
handle_event_file_send_error
)
con
.
register_handler
(
'
STANZA_ARRIVED
'
,
self
.
handle_event_stanza_arrived
)
con
.
register_handler
(
'
STANZA_SENT
'
,
self
.
handle_event_stanza_sent
)
...
...
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