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
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
gajim
gajim-plugins
Commits
9362c592
Commit
9362c592
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
[omemo] KeyDialog: Show last seen timestamp
parent
d94d1550
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
omemo/backend/liteaxolotlstore.py
+8
-2
8 additions, 2 deletions
omemo/backend/liteaxolotlstore.py
omemo/gtk/key.py
+23
-12
23 additions, 12 deletions
omemo/gtk/key.py
omemo/gtk/style.css
+2
-0
2 additions, 0 deletions
omemo/gtk/style.css
with
33 additions
and
14 deletions
omemo/backend/liteaxolotlstore.py
+
8
−
2
View file @
9362c592
...
...
@@ -479,14 +479,20 @@ class LiteAxolotlStore(AxolotlStore):
def
getFingerprints
(
self
,
jid
):
query
=
'''
SELECT recipient_id as
"
recipient_id [jid]
"
,
public_key as
"
public_key [pk]
"
, trust FROM identities
public_key as
"
public_key [pk]
"
,
trust,
timestamp
FROM identities
WHERE recipient_id = ? ORDER BY trust ASC
'''
return
self
.
_con
.
execute
(
query
,
(
jid
,)).
fetchall
()
def
getMucFingerprints
(
self
,
jids
):
query
=
'''
SELECT recipient_id as
"
recipient_id [jid]
"
,
public_key as
"
public_key [pk]
"
, trust FROM identities
public_key as
"
public_key [pk]
"
,
trust,
timestamp
FROM identities
WHERE recipient_id IN ({}) ORDER BY trust ASC
'''
.
format
(
'
,
'
.
join
([
'
?
'
]
*
len
(
jids
)))
...
...
This diff is collapsed.
Click to expand it.
omemo/gtk/key.py
+
23
−
12
View file @
9362c592
...
...
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with OMEMO Gajim Plugin. If not, see <http://www.gnu.org/licenses/>.
import
time
import
logging
from
gi.repository
import
Gtk
...
...
@@ -131,7 +132,8 @@ class KeyDialog(Gtk.Dialog):
for
result
in
results
:
rows
[
result
.
public_key
]
=
KeyRow
(
result
.
recipient_id
,
result
.
public_key
,
result
.
trust
)
result
.
trust
,
result
.
timestamp
)
for
item
in
sessions
:
if
item
.
record
.
isFresh
():
...
...
@@ -158,7 +160,7 @@ class KeyDialog(Gtk.Dialog):
class
KeyRow
(
Gtk
.
ListBoxRow
):
def
__init__
(
self
,
jid
,
identity_key
,
trust
):
def
__init__
(
self
,
jid
,
identity_key
,
trust
,
last_seen
):
Gtk
.
ListBoxRow
.
__init__
(
self
)
self
.
set_activatable
(
False
)
...
...
@@ -168,21 +170,19 @@ class KeyRow(Gtk.ListBoxRow):
self
.
trust
=
trust
self
.
jid
=
jid
box
=
Gtk
.
Box
()
box
.
set_spacing
(
12
)
grid
=
Gtk
.
Grid
()
grid
.
set_column_spacing
(
12
)
self
.
_trust_button
=
TrustButton
(
self
)
box
.
add
(
self
.
_trust_button
)
grid
.
attach
(
self
.
_trust_button
,
1
,
1
,
1
,
3
)
label_box
=
Gtk
.
Box
(
orientation
=
Gtk
.
Orientation
.
VERTICAL
)
jid_label
=
Gtk
.
Label
(
label
=
jid
)
jid_label
.
get_style_context
().
add_class
(
'
dim-label
'
)
jid_label
.
set_selectable
(
False
)
jid_label
.
set_halign
(
Gtk
.
Align
.
START
)
jid_label
.
set_valign
(
Gtk
.
Align
.
START
)
jid_label
.
set_hexpand
(
True
)
label_box
.
add
(
jid_label
)
grid
.
attach
(
jid_label
,
2
,
1
,
1
,
1
)
self
.
fingerprint
=
Gtk
.
Label
(
label
=
self
.
_identity_key
.
get_fingerprint
(
formatted
=
True
))
...
...
@@ -192,11 +192,22 @@ class KeyRow(Gtk.ListBoxRow):
self
.
fingerprint
.
set_halign
(
Gtk
.
Align
.
START
)
self
.
fingerprint
.
set_valign
(
Gtk
.
Align
.
START
)
self
.
fingerprint
.
set_hexpand
(
True
)
label_box
.
add
(
self
.
fingerprint
)
grid
.
attach
(
self
.
fingerprint
,
2
,
2
,
1
,
1
)
box
.
add
(
label_box
)
self
.
add
(
box
)
if
last_seen
is
not
None
:
last_seen
=
time
.
strftime
(
'
%d-%m-%Y %H:%M:%S
'
,
time
.
localtime
(
last_seen
))
else
:
last_seen
=
_
(
'
Never
'
)
last_seen_label
=
Gtk
.
Label
(
label
=
_
(
'
Last seen: %s
'
)
%
last_seen
)
last_seen_label
.
set_halign
(
Gtk
.
Align
.
START
)
last_seen_label
.
set_valign
(
Gtk
.
Align
.
START
)
last_seen_label
.
set_hexpand
(
True
)
last_seen_label
.
get_style_context
().
add_class
(
'
omemo-last-seen
'
)
last_seen_label
.
get_style_context
().
add_class
(
'
dim-label
'
)
grid
.
attach
(
last_seen_label
,
2
,
3
,
1
,
1
)
self
.
add
(
grid
)
self
.
show_all
()
def
delete_fingerprint
(
self
,
*
args
):
...
...
This diff is collapsed.
Click to expand it.
omemo/gtk/style.css
+
2
−
0
View file @
9362c592
...
...
@@ -3,6 +3,8 @@
.omemo-mono
{
font-size
:
12px
;
font-family
:
monospace
;
}
.omemo-last-seen
{
font-size
:
11px
;
}
.omemo-key-dialog
>
box
{
margin
:
18px
;
}
.omemo-key-dialog
scrolledwindow
row
{
...
...
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