Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
d919f0af
Commit
d919f0af
authored
Aug 18, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load last contacts/messages ordered by timestamp
parent
5fad8a2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
history.py
blink/history.py
+2
-2
No files found.
blink/history.py
View file @
d919f0af
...
@@ -401,7 +401,7 @@ class MessageHistory(object, metaclass=Singleton):
...
@@ -401,7 +401,7 @@ class MessageHistory(object, metaclass=Singleton):
# print('-- Loading messages')
# print('-- Loading messages')
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
try
:
try
:
result
=
Message
.
selectBy
(
remote_uri
=
uri
)[
-
100
:]
result
=
Message
.
selectBy
(
remote_uri
=
uri
)
.
orderBy
(
'timestamp'
)
[
-
100
:]
except
Exception
as
e
:
except
Exception
as
e
:
notification_center
.
post_notification
(
'BlinkMessageHistoryLoadDidFail'
,
sender
=
session
,
data
=
NotificationData
(
uri
=
uri
))
notification_center
.
post_notification
(
'BlinkMessageHistoryLoadDidFail'
,
sender
=
session
,
data
=
NotificationData
(
uri
=
uri
))
return
return
...
@@ -412,7 +412,7 @@ class MessageHistory(object, metaclass=Singleton):
...
@@ -412,7 +412,7 @@ class MessageHistory(object, metaclass=Singleton):
def
get_last_contacts
(
self
,
number
=
5
):
def
get_last_contacts
(
self
,
number
=
5
):
# print(f'-- Getting last {number} contacts wtih messages')
# print(f'-- Getting last {number} contacts wtih messages')
query
=
f
'select
distinct(remote_uri) from messages order by id
desc limit {Message.sqlrepr(number)}'
query
=
f
'select
remote_uri, max(timestamp) from messages group by remote_uri order by timestamp
desc limit {Message.sqlrepr(number)}'
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
try
:
try
:
result
=
self
.
db
.
queryAll
(
query
)
result
=
self
.
db
.
queryAll
(
query
)
...
...
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