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
G
gajim-plugins
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim-plugins
Commits
f41a747e
Commit
f41a747e
authored
Jun 10, 2017
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pgp] Add encrypted file uploads via HTTPUpload
parent
7d9f7785
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
pgp/pgpplugin.py
pgp/pgpplugin.py
+28
-0
No files found.
pgp/pgpplugin.py
View file @
f41a747e
...
...
@@ -246,6 +246,34 @@ class OldPGPPlugin(GajimPlugin):
print_msg_to_log
(
obj
.
msg_iq
)
callback
(
obj
)
def
encrypt_file
(
self
,
file
,
account
,
callback
):
thread
=
threading
.
Thread
(
target
=
self
.
_encrypt_file_thread
,
args
=
(
file
,
account
,
callback
))
thread
.
daemon
=
True
thread
.
start
()
def
_encrypt_file_thread
(
self
,
file
,
account
,
callback
):
my_key_id
=
gajim
.
config
.
get_per
(
'accounts'
,
account
,
'keyid'
)
key_list
=
[
file
.
control
.
contact
.
keyID
,
my_key_id
]
encrypted
=
self
.
get_gpg
(
account
).
encrypt_file
(
file
.
get_data
(),
key_list
)
if
not
encrypted
:
GLib
.
idle_add
(
self
.
_on_file_encryption_error
,
file
,
encrypted
.
status
)
return
file
.
encrypted
=
True
file
.
size
=
len
(
encrypted
.
data
)
file
.
path
+=
'.pgp'
file
.
data
=
encrypted
.
data
if
file
.
event
.
isSet
():
return
GLib
.
idle_add
(
callback
,
file
)
@
staticmethod
def
_on_file_encryption_error
(
file
,
error
):
dialogs
.
ErrorDialog
(
_
(
'Error'
),
error
,
transient_for
=
file
.
control
.
parent_win
.
window
)
@
staticmethod
def
cleanup_stanza
(
obj
):
''' We make sure only allowed tags are in the stanza '''
...
...
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