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
0e63a8bd
Commit
0e63a8bd
authored
13 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
update gotr plugin from afflux's git repos
parent
735e0165
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gotr/manifest.ini
+1
-1
1 addition, 1 deletion
gotr/manifest.ini
gotr/otrmodule.py
+3
-6
3 additions, 6 deletions
gotr/otrmodule.py
gotr/ui.py
+8
-6
8 additions, 6 deletions
gotr/ui.py
with
12 additions
and
13 deletions
gotr/manifest.ini
+
1
−
1
View file @
0e63a8bd
[info]
name:
Off-The-Record
Encryption
short_name:
gotr
version:
1
version:
1
.1
description:
See
http://www.cypherpunks.ca/otr/
authors:
Kjell
Braden
<afflux.gajim@pentabarf.de>
homepage:
http://gajim-otr.pentabarf.de
This diff is collapsed.
Click to expand it.
gotr/otrmodule.py
+
3
−
6
View file @
0e63a8bd
...
...
@@ -29,7 +29,7 @@ Off-The-Record encryption plugin.
:license: GPL
'''
MINVERSION
=
(
1
,
0
,
0
,
'
beta
1
'
)
# 1.0-alpha1
MINVERSION
=
(
1
,
0
,
0
,
'
beta
3
'
)
IGNORE
=
True
PASS
=
False
...
...
@@ -80,7 +80,7 @@ class GajimContext(potr.context.Context):
self
.
smpWindow
=
ui
.
ContactOtrSmpWindow
(
self
)
def
inject
(
self
,
msg
,
appdata
=
None
):
log
.
warnin
g
(
'
inject(appdata=%s)
'
,
appdata
)
log
.
debu
g
(
'
inject(appdata=%s)
'
,
appdata
)
msg
=
unicode
(
msg
)
account
=
self
.
user
.
accountname
...
...
@@ -134,7 +134,7 @@ class GajimContext(potr.context.Context):
def
getPolicy
(
self
,
key
):
jid
=
gajim
.
get_room_and_nick_from_fjid
(
self
.
peer
)[
0
]
ret
=
self
.
user
.
plugin
.
get_flags
(
self
.
user
.
accountname
,
jid
)[
key
]
log
.
warnin
g
(
'
getPolicy(key=%s) = %s
'
,
key
,
ret
)
log
.
debu
g
(
'
getPolicy(key=%s) = %s
'
,
key
,
ret
)
return
ret
class
GajimOtrAccount
(
potr
.
context
.
Account
):
...
...
@@ -502,15 +502,12 @@ class OtrPlugin(GajimPlugin):
if
xep_200
or
not
event
.
message
:
return
PASS
print
event
if
event
.
session
:
fjid
=
event
.
session
.
get_to
()
else
:
fjid
=
event
.
jid
if
event
.
resource
:
fjid
+=
'
/
'
+
event
.
resource
print
(
fjid
,
event
.
session
,
event
.
jid
,
event
.
resource
)
try
:
newmsg
=
self
.
us
[
event
.
account
].
getContext
(
fjid
).
sendMessage
(
...
...
This diff is collapsed.
Click to expand it.
gotr/ui.py
+
8
−
6
View file @
0e63a8bd
...
...
@@ -64,10 +64,10 @@ class OtrPluginConfigDialog(GajimPluginConfigDialog):
self
.
flags
[
flagName
]
=
self
.
B
.
get_object
(
checkBoxName
)
self
.
B
.
connect_signals
(
self
)
self
.
account_combobox_changed_cb
(
self
.
B
.
get_object
(
'
account_combobox
'
))
def
on_run
(
self
):
self
.
plugin
.
update_context_list
()
self
.
account_combobox_changed_cb
(
self
.
B
.
get_object
(
'
account_combobox
'
))
def
flags_toggled_cb
(
self
,
button
):
if
button
==
self
.
B
.
get_object
(
'
enable_check
'
):
...
...
@@ -106,7 +106,7 @@ class OtrPluginConfigDialog(GajimPluginConfigDialog):
for
key
,
box
in
self
.
flags
.
iteritems
():
box
.
set_active
(
otr_flags
[
key
])
fpr
=
str
(
self
.
plugin
.
us
[
account
].
getPrivkey
())
fpr
=
str
(
self
.
plugin
.
us
[
account
].
getPrivkey
(
autogen
=
False
))
regen_button
.
set_label
(
'
Regenerate
'
)
else
:
regen_button
.
set_sensitive
(
False
)
...
...
@@ -178,7 +178,12 @@ class OtrPluginConfigDialog(GajimPluginConfigDialog):
if
active
>
-
1
:
account
=
self
.
otr_account_store
[
active
][
0
]
button
.
set_sensitive
(
False
)
self
.
plugin
.
us
[
account
].
dropPrivkey
()
try
:
self
.
plugin
.
us
[
account
].
getPrivkey
(
autogen
=
False
)
self
.
plugin
.
us
[
account
].
dropPrivkey
()
except
LookupError
:
pass
self
.
plugin
.
us
[
account
].
getPrivkey
(
autogen
=
True
)
self
.
account_combobox_changed_cb
(
box
,
*
args
)
button
.
set_sensitive
(
True
)
...
...
@@ -317,7 +322,6 @@ class ContactOtrSmpWindow:
self
.
plugin
.
update_context_list
()
def
get_tlv
(
self
,
tlvs
,
check
):
print
(
tlvs
,
check
)
for
tlv
in
tlvs
:
if
isinstance
(
tlv
,
check
):
return
tlv
...
...
@@ -500,7 +504,6 @@ class ContactOtrWindow(gtk.Dialog):
# settings if available
self
.
plugin
.
set_flags
(
None
,
self
.
account
,
self
.
jid
)
else
:
print
"
got per-contact settings
"
# build the flags using the checkboxes
flags
=
{}
flags
[
'
ALLOW_V2
'
]
=
\
...
...
@@ -512,7 +515,6 @@ class ContactOtrWindow(gtk.Dialog):
flags
[
'
WHITESPACE_START_AKE
'
]
=
\
self
.
gw
(
'
otr_policy_start_on_tag_checkbutton
'
).
get_active
()
print
"
per-contact settings:
"
,
flags
self
.
plugin
.
set_flags
(
flags
,
self
.
account
,
self
.
jid
)
def
_otr_default_checkbutton_toggled
(
self
,
widget
):
...
...
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