[folks] telepathy: Update behaviour of Zeitgeist properties



commit ee359e89f3332d2c8cb1bd29e8ea54e62798d65b
Author: Seif Lotfy <seif lotfy com>
Date:   Tue Sep 11 12:10:40 2012 +0200

    telepathy: Update behaviour of Zeitgeist properties
    
    Counter works for last 30 days instead of all time since it can
    mess up calculations easily.
    Reduce query size to Zeitgeist since events are filtered in the
    Persona class.
    
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=672709 (again)

 NEWS                                          |    2 ++
 backends/telepathy/lib/tpf-persona-store.vala |   17 +++++++----------
 2 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/NEWS b/NEWS
index 512ca7a..b775862 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Bugs fixed:
 â Bug 684014 â A few outstanding issues in the internationalisation
 â Bug 683390 â Individuals sometimes not removed when disabling their
   Telepathy account
+â Bug 672709 â Add new interaction details properties to individuals
+  (follow-up patch)
 
 Overview of changes from libfolks 0.7.4 to libfolks 0.7.4.1
 ===========================================================
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 2b7d678..786969a 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -1731,18 +1731,10 @@ public class Tpf.PersonaStore : Folks.PersonaStore
        * Zeitgeist */
       var origin = this.id.replace (TelepathyGLib.ACCOUNT_OBJECT_PATH_BASE,
                                     "x-telepathy-account-path:");
-
       Event ev1 = new Event.full ("", "", "dbus://org.freedesktop.Telepathy.Logger.service");
-      ev1.add_subject (new Subject.full ("", Zeitgeist.NMO_IMMESSAGE, "", "", "", "", ""));
       ev1.set_origin (origin);
-
-      Event ev2 = new Event.full ("", "", "dbus://org.freedesktop.Telepathy.Logger.service");
-      ev2.add_subject (new Subject.full ("", "", Zeitgeist.NFO_MEDIA_STREAM, "", "", "", ""));
-      ev2.set_origin (origin);
-
       var templates = new PtrArray ();
       templates.add (ev1.ref ());
-      templates.add (ev2.ref ());
       return templates;
     }
 
@@ -1757,11 +1749,16 @@ public class Tpf.PersonaStore : Folks.PersonaStore
        * the counters of the personas */
       try
         {
+          TimeVal tm = TimeVal ();
+          int64 end_timestamp = tm.tv_sec;
+          /* We want events from the last 30 days only, A day has 86400 seconds.
+           * start_timestamp = end_timestamp - 30 days in seconds*/
+          int64 start_timestamp = end_timestamp - (86400 * 30);
           PtrArray events = this._get_zeitgeist_event_templates ();
-          var results = yield this._log.find_events (new TimeRange.anytime (),
+          var results = yield this._log.find_events (
+              new TimeRange (start_timestamp * 1000, end_timestamp * 1000),
               (owned) events, StorageState.ANY, 0, ResultType.MOST_RECENT_EVENTS,
               null);
-
           foreach (var persona in this._personas.values)
             {
               persona.freeze_notify ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]