Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Bronko
gajim
Commits
77ed800a
Commit
77ed800a
authored
Dec 20, 2019
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HTTPUpload: Remove session argument
parent
274b22db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
25 deletions
+20
-25
gajim/chat_control_base.py
gajim/chat_control_base.py
+6
-8
gajim/common/modules/httpupload.py
gajim/common/modules/httpupload.py
+14
-16
gajim/gui_interface.py
gajim/gui_interface.py
+0
-1
No files found.
gajim/chat_control_base.py
View file @
77ed800a
...
...
@@ -819,19 +819,18 @@ class ChatControlBase(ChatCommandProcessor, CommandTools, EventHelper):
if
httpupload
.
get_enabled
():
# use httpupload
con
.
get_module
(
'HTTPUpload'
).
check_file_before_transfer
(
path
,
self
.
encryption
,
self
.
contact
,
self
.
session
,
groupchat
=
True
)
path
,
self
.
encryption
,
self
.
contact
,
groupchat
=
True
)
else
:
if
httpupload
.
get_enabled
()
and
jingle
.
get_enabled
():
if
ft_pref
==
'httpupload'
:
con
.
get_module
(
'HTTPUpload'
).
check_file_before_transfer
(
path
,
self
.
encryption
,
self
.
contact
,
self
.
session
)
path
,
self
.
encryption
,
self
.
contact
)
else
:
ft
=
app
.
interface
.
instances
[
'file_transfers'
]
ft
.
send_file
(
self
.
account
,
self
.
contact
,
path
)
elif
httpupload
.
get_enabled
():
con
.
get_module
(
'HTTPUpload'
).
check_file_before_transfer
(
path
,
self
.
encryption
,
self
.
contact
,
self
.
session
)
path
,
self
.
encryption
,
self
.
contact
)
elif
jingle
.
get_enabled
():
ft
=
app
.
interface
.
instances
[
'file_transfers'
]
ft
.
send_file
(
self
.
account
,
self
.
contact
,
path
)
...
...
@@ -999,19 +998,18 @@ class ChatControlBase(ChatCommandProcessor, CommandTools, EventHelper):
if
httpupload
.
get_enabled
():
# use httpupload
con
.
get_module
(
'HTTPUpload'
).
check_file_before_transfer
(
path
,
self
.
encryption
,
contact
,
self
.
session
,
groupchat
=
True
)
path
,
self
.
encryption
,
contact
,
groupchat
=
True
)
else
:
if
httpupload
.
get_enabled
()
and
jingle
.
get_enabled
():
if
ft_pref
==
'httpupload'
:
con
.
get_module
(
'HTTPUpload'
).
check_file_before_transfer
(
path
,
self
.
encryption
,
contact
,
self
.
session
)
path
,
self
.
encryption
,
contact
)
else
:
ft
=
app
.
interface
.
instances
[
'file_transfers'
]
ft
.
send_file
(
self
.
account
,
contact
,
path
)
elif
httpupload
.
get_enabled
():
con
.
get_module
(
'HTTPUpload'
).
check_file_before_transfer
(
path
,
self
.
encryption
,
contact
,
self
.
session
)
path
,
self
.
encryption
,
contact
)
elif
jingle
.
get_enabled
():
ft
=
app
.
interface
.
instances
[
'file_transfers'
]
ft
.
send_file
(
self
.
account
,
contact
,
path
)
...
...
gajim/common/modules/httpupload.py
View file @
77ed800a
...
...
@@ -109,7 +109,7 @@ class HTTPUpload(BaseModule):
oob
.
addChild
(
'url'
).
setData
(
body
)
event
.
additional_data
.
set_value
(
'gajim'
,
'oob_url'
,
body
)
def
check_file_before_transfer
(
self
,
path
,
encryption
,
contact
,
session
,
def
check_file_before_transfer
(
self
,
path
,
encryption
,
contact
,
groupchat
=
False
):
if
not
path
or
not
os
.
path
.
exists
(
path
):
return
...
...
@@ -148,7 +148,6 @@ class HTTPUpload(BaseModule):
self
.
_account
,
mime
,
encryption
,
session
,
groupchat
)
app
.
interface
.
show_httpupload_progress
(
file
)
except
Exception
as
error
:
...
...
@@ -316,15 +315,20 @@ class HTTPUpload(BaseModule):
self
.
_text
.
append
(
uri
)
if
file
.
is_groupchat
:
app
.
nec
.
push_outgoing_event
(
GcMessageOutgoingEvent
(
None
,
account
=
self
.
_account
,
jid
=
file
.
contact
.
jid
,
message
=
uri
,
automatic_message
=
False
,
session
=
file
.
session
))
app
.
nec
.
push_outgoing_event
(
GcMessageOutgoingEvent
(
None
,
account
=
self
.
_account
,
jid
=
file
.
contact
.
jid
,
message
=
uri
,
automatic_message
=
False
))
else
:
app
.
nec
.
push_outgoing_event
(
MessageOutgoingEvent
(
None
,
account
=
self
.
_account
,
jid
=
file
.
contact
.
jid
,
message
=
uri
,
type_
=
'chat'
,
automatic_message
=
False
,
session
=
file
.
session
))
app
.
nec
.
push_outgoing_event
(
MessageOutgoingEvent
(
None
,
account
=
self
.
_account
,
jid
=
file
.
contact
.
jid
,
message
=
uri
,
type_
=
'chat'
,
automatic_message
=
False
))
else
:
phrase
=
Soup
.
Status
.
get_phrase
(
message
.
props
.
status_code
)
...
...
@@ -360,7 +364,6 @@ class File:
account
,
mime
,
encryption
,
session
,
groupchat
):
self
.
_path
=
path
...
...
@@ -369,7 +372,6 @@ class File:
self
.
_contact
=
contact
self
.
_account
=
account
self
.
_mime
=
mime
self
.
_session
=
session
self
.
size
=
os
.
stat
(
path
).
st_size
self
.
put_uri
=
None
...
...
@@ -393,10 +395,6 @@ class File:
def
contact
(
self
):
return
self
.
_contact
@
property
def
session
(
self
):
return
self
.
_session
@
property
def
is_groupchat
(
self
):
return
self
.
_groupchat
...
...
gajim/gui_interface.py
View file @
77ed800a
...
...
@@ -875,7 +875,6 @@ class Interface:
path
,
chat_control
.
encryption
,
chat_control
.
contact
,
chat_control
.
session
,
chat_control
.
is_groupchat
)
def
encrypt_file
(
self
,
file
,
account
,
callback
):
...
...
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