[gdr_gdr] Add a file transfer completed event. Fixes # 8266
This commit is contained in:
parent
7740f8ccf4
commit
766bb508e3
|
@ -2310,6 +2310,15 @@ class FileRequestErrorEvent(nec.NetworkIncomingEvent):
|
|||
self.jid = gajim.get_jid_without_resource(self.jid)
|
||||
return True
|
||||
|
||||
class FileTransferCompletedEvent(nec.NetworkIncomingEvent):
|
||||
name = 'file-transfer-completed'
|
||||
base_network_events = []
|
||||
|
||||
def generate(self):
|
||||
jid = unicode(self.file_props.receiver)
|
||||
self.jid = gajim.get_jid_without_resource(jid)
|
||||
return True
|
||||
|
||||
class GatewayPromptReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
|
||||
name = 'gateway-prompt-received'
|
||||
base_network_events = []
|
||||
|
|
|
@ -82,7 +82,7 @@ from common import dataforms
|
|||
from common import passwords
|
||||
from common import logging_helpers
|
||||
from common.connection_handlers_events import OurShowEvent, \
|
||||
FileRequestErrorEvent, InformationEvent
|
||||
FileRequestErrorEvent, FileTransferCompletedEvent, InformationEvent
|
||||
from common.connection import Connection
|
||||
from common import jingle
|
||||
from common.file_props import FilesProp
|
||||
|
@ -996,6 +996,8 @@ class Interface:
|
|||
if file_props.error == 0:
|
||||
ft.set_progress(file_props.type_, file_props.sid,
|
||||
file_props.received_len)
|
||||
gajim.nec.push_incoming_event(FileTransferCompletedEvent(None,
|
||||
file_props=file_props))
|
||||
else:
|
||||
ft.set_status(file_props, 'stop')
|
||||
if file_props.stalled or file_props.paused:
|
||||
|
|
Loading…
Reference in New Issue