[polari/wip/carlosg/tracker: 16/16] logger: Resolve whether sender is self on bind()



commit 1b491148bcce760ec3ae26cca0c973daec73c14c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Feb 24 23:41:25 2019 +0100

    logger: Resolve whether sender is self on bind()
    
    This turns out to be easier on the query planner.

 src/logger.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/logger.js b/src/logger.js
index fd4287b..b8cdf2b 100644
--- a/src/logger.js
+++ b/src/logger.js
@@ -152,11 +152,12 @@ var LogWalker = class {
                        polari:nick(?sender) as ?sender
                        ?time
                        polari:isAction(?msg) as ?isAction
-                       (exists { ?sender a polari:SelfContact }) as ?isSelf
+                       ?isSelf
                 { ?msg a polari:Message;
                        polari:time ?time;
                        polari:sender ?sender;
-                       polari:channel <${channel}>
+                       polari:channel <${channel}> .
+                       bind (exists { ?sender a polari:SelfContact } as ?isSelf)
                 } 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]