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
Bronko
gajim
Commits
1b1ca88c
Commit
1b1ca88c
authored
Dec 10, 2019
by
Philipp Hörist
Browse files
Interface: Simplify event code
parent
e00dad0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
gajim/common/connection_handlers_events.py
View file @
1b1ca88c
...
...
@@ -168,14 +168,6 @@ def generate(self):
self
.
file_props
.
transfered_size
=
[]
return
True
class
FileTransferCompletedEvent
(
nec
.
NetworkIncomingEvent
):
name
=
'file-transfer-completed'
def
generate
(
self
):
jid
=
str
(
self
.
file_props
.
receiver
)
self
.
jid
=
app
.
get_jid_without_resource
(
jid
)
return
True
class
NotificationEvent
(
nec
.
NetworkIncomingEvent
):
name
=
'notification'
base_network_events
=
[
'decrypted-message-received'
,
...
...
gajim/gui_interface.py
View file @
1b1ca88c
...
...
@@ -77,8 +77,7 @@
from
gajim.common.structs
import
MUCData
from
gajim.common.nec
import
NetworkEvent
from
gajim.common.i18n
import
_
from
gajim.common.connection_handlers_events
import
(
OurShowEvent
,
FileTransferCompletedEvent
)
from
gajim.common.connection_handlers_events
import
OurShowEvent
from
gajim.common.modules.httpupload
import
HTTPUploadProgressEvent
from
gajim.common.connection
import
Connection
...
...
@@ -637,8 +636,12 @@ def handle_event_file_rcv_completed(self, account, file_props):
if
file_props
.
error
==
0
:
ft
.
set_progress
(
file_props
.
type_
,
file_props
.
sid
,
file_props
.
received_len
)
jid
=
app
.
get_jid_without_resource
(
str
(
file_props
.
receiver
))
app
.
nec
.
push_incoming_event
(
FileTransferCompletedEvent
(
None
,
file_props
=
file_props
))
NetworkEvent
(
'file-transfer-completed'
,
file_props
=
file_props
,
jid
=
jid
))
else
:
ft
.
set_status
(
file_props
,
'stop'
)
if
not
file_props
.
completed
and
(
file_props
.
stalled
or
...
...
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