Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
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
Evert Mouw
gajim-plugins
Commits
b6058387
Commit
b6058387
authored
13 years ago
by
Kjell Braden
Browse files
Options
Downloads
Patches
Plain Diff
make gotr plugin less verbose, fix key regeneration
parent
6cfe3ef8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gotr/otrmodule.py
+15
-4
15 additions, 4 deletions
gotr/otrmodule.py
gotr/ui.py
+1
-1
1 addition, 1 deletion
gotr/ui.py
with
16 additions
and
5 deletions
gotr/otrmodule.py
+
15
−
4
View file @
b6058387
...
...
@@ -145,13 +145,23 @@ class GajimOtrAccount(potr.context.Account):
super
(
GajimOtrAccount
,
self
).
__init__
(
name
,
PROTOCOL
,
MMS
)
self
.
keyFilePath
=
os
.
path
.
join
(
gajim
.
gajimpaths
.
data_root
,
accountname
)
def
dropPrivkey
(
self
):
try
:
os
.
remove
(
self
.
keyFilePath
+
'
.key2
'
)
except
IOError
,
e
:
if
e
.
errno
!=
2
:
log
.
exception
(
'
IOError occurred when removing key file for %s
'
,
self
.
name
)
self
.
privkey
=
None
def
loadPrivkey
(
self
):
try
:
with
open
(
self
.
keyFilePath
+
'
.key2
'
,
'
r
'
)
as
keyFile
:
return
pickle
.
load
(
keyFile
)
except
IOError
,
e
:
log
.
exception
(
'
IOError occurred when loading key file for %s
'
,
self
.
name
)
if
e
.
errno
!=
2
:
log
.
exception
(
'
IOError occurred when loading key file for %s
'
,
self
.
name
)
return
None
def
savePrivkey
(
self
):
...
...
@@ -176,8 +186,9 @@ class GajimOtrAccount(potr.context.Account):
self
.
getContext
(
ctx
,
newCtxCb
).
setTrust
(
fpr
,
trust
)
except
IOError
,
e
:
log
.
exception
(
'
IOError occurred when loading fpr file for %s
'
,
self
.
name
)
if
e
.
errno
!=
2
:
log
.
exception
(
'
IOError occurred when loading fpr file for %s
'
,
self
.
name
)
def
saveTrusts
(
self
):
try
:
...
...
This diff is collapsed.
Click to expand it.
gotr/ui.py
+
1
−
1
View file @
b6058387
...
...
@@ -179,7 +179,7 @@ class OtrPluginConfigDialog(GajimPluginConfigDialog):
if
active
>
-
1
:
account
=
self
.
otr_account_store
[
active
][
0
]
button
.
set_sensitive
(
False
)
self
.
plugin
.
us
[
account
].
p
rivkey
=
None
self
.
plugin
.
us
[
account
].
dropP
rivkey
()
self
.
account_combobox_changed_cb
(
box
,
*
args
)
button
.
set_sensitive
(
True
)
...
...
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