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
0d68d815
Commit
0d68d815
authored
19 years ago
by
dkirov
Browse files
Options
Downloads
Patches
Plain Diff
handle file request/send errors
parent
99a20589
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
+36
-10
36 additions, 10 deletions
src/gajim.py
with
36 additions
and
10 deletions
src/gajim.py
+
36
−
10
View file @
0d68d815
...
...
@@ -159,13 +159,30 @@ class Interface:
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
'
]
# show the error dialog
ft
=
self
.
windows
[
'
file_transfers
'
]
sid
=
id
if
len
(
id
)
>
3
and
id
[
2
]
==
'
_
'
:
sid
=
id
[
3
:]
if
ft
.
files_props
[
'
s
'
].
has_key
(
sid
):
file_props
=
ft
.
files_props
[
'
s
'
][
sid
]
file_props
[
'
error
'
]
=
-
4
self
.
handle_event_file_request_error
(
account
,
(
jid_from
,
file_props
))
conn
=
gajim
.
connections
[
account
]
conn
.
disconnect_transfer
(
file_props
)
return
elif
str
(
errcode
)
==
'
404
'
:
conn
=
gajim
.
connections
[
account
]
sid
=
id
[
3
:]
return
sid
=
id
if
len
(
id
)
>
3
and
id
[
2
]
==
'
_
'
:
sid
=
id
[
3
:]
if
conn
.
files_props
.
has_key
(
sid
):
file_props
=
conn
.
files_props
[
sid
]
self
.
handle_event_file_send_error
(
account
,
(
jid_from
,
file_props
))
conn
.
disconnect_transfer
(
file_props
)
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
(
...
...
@@ -677,31 +694,40 @@ class Interface:
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
)
ft
=
self
.
windows
[
'
file_transfers
'
]
ft
.
set_status
(
file_props
[
'
type
'
],
file_props
[
'
sid
'
],
'
stop
'
)
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
)
_
(
'
File Transfer Error
'
),
jid
,
account
,
'
file-
send-
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
]
errno
=
file_props
[
'
error
'
]
ft
=
self
.
windows
[
'
file_transfers
'
]
ft
.
set_status
(
file_props
[
'
type
'
],
file_props
[
'
sid
'
],
'
stop
'
)
if
gajim
.
config
.
get
(
'
notify_on_new_message
'
):
# check if we should be notified
if
errno
==
-
4
:
msg_type
=
'
file-error
'
else
:
msg_type
=
'
file-request-error
'
instance
=
dialogs
.
PopupNotificationWindow
(
self
,
_
(
'
File Transfer Error
'
),
jid
,
account
,
'
file-error
'
,
file_props
)
_
(
'
File Transfer Error
'
),
jid
,
account
,
msg_type
,
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
)
if
errno
==
-
4
:
self
.
windows
[
'
file_transfers
'
].
show_stopped
(
file_props
)
else
:
self
.
windows
[
'
file_transfers
'
].
show_request_error
(
file_props
)
def
handle_event_file_request
(
self
,
account
,
array
):
jid
=
array
[
0
]
...
...
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