[polari/wip/carlosg/tracker: 8/13] logger: Build channel URN for query
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/carlosg/tracker: 8/13] logger: Build channel URN for query
- Date: Sun, 24 Feb 2019 22:59:14 +0000 (UTC)
commit 6f093f54c0f706f33429ebead8f483279baf6335
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Feb 24 23:03:33 2019 +0100
logger: Build channel URN for query
Channels have a guessable name, and it speeds up the query
considerably.
src/logger.js | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/logger.js b/src/logger.js
index 448cb89..0ca64e5 100644
--- a/src/logger.js
+++ b/src/logger.js
@@ -146,6 +146,7 @@ var LogWalker = class {
if (!this._query) {
this._query = new GenericQuery(numEvents);
+ let channel =
Tracker.sparql_escape_uri(`urn:channel:${this._room.account.get_path_suffix()}:${this._room.channel_name}`);
let sparql = `
select polari:text(?msg) as ?text
polari:nick(?sender) as ?sender
@@ -154,10 +155,7 @@ var LogWalker = class {
(exists { ?sender a polari:SelfContact }) as ?isSelf
{ ?msg a polari:Message;
polari:sender ?sender;
- polari:channel ?chan .
- ?chan polari:account ?account;
- polari:name "${this._room.channel_name}" .
- ?account polari:id "${this._room.account.get_path_suffix()}"
+ polari:channel <${channel}>
} order by desc(?time) desc(tracker:id(?msg))
`;
this._query.run(sparql, null, returnFunc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]