Commit ee359e89 authored by Seif Lotfy's avatar Seif Lotfy Committed by Philip Withnall

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)
parent 0f078082
......@@ -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
===========================================================
......
......@@ -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 ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment