private Account _account;
#if HAVE_ZEITGEIST
- private Zeitgeist.Log? _log= null;
+ private Zeitgeist.Log? _log = null;
private Zeitgeist.Monitor? _monitor = null;
#endif
this._account_manager_invalidated_cb);
this._account_manager = null;
}
+#if HAVE_ZEITGEIST
+ if (this._monitor != null)
+ {
+ this._log.remove_monitor (this._monitor);
+ this._monitor = null;
+ }
+#endif
}
private string _format_maybe_bool (MaybeBool input)
{
for (var i = 1; i < e.num_subjects (); i++)
{
- var id = this._get_iid_from_event_metadata (e.get_subject (i).get_uri ());
- var interaction_type = e.get_subject (0).get_interpretation ();
+ var id = this._get_iid_from_event_metadata (e.get_subject (i).uri);
+ var interaction_type = e.get_subject (0).interpretation;
this._increase_persona_counter (id, interaction_type, e);
}
}
}
- private PtrArray _get_zeitgeist_event_templates ()
+ private GLib.GenericArray<Zeitgeist.Event> _get_zeitgeist_event_templates ()
{
/* To fetch events from Zeitgeist about the interaction with contacts we
* create templates reflecting how the telepathy-logger stores events in
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.set_origin (origin);
- var templates = new PtrArray ();
- templates.add (ev1.ref ());
+ ev1.origin = origin;
+ var templates = new GLib.GenericArray<Zeitgeist.Event> ();
+ templates.add (ev1);
return templates;
}
/* 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 ();
+ GLib.GenericArray<Zeitgeist.Event> events = this._get_zeitgeist_event_templates ();
var results = yield this._log.find_events (
new TimeRange (start_timestamp * 1000, end_timestamp * 1000),
- (owned) events, StorageState.ANY, 0, ResultType.MOST_RECENT_EVENTS,
+ events, StorageState.ANY, 0, ResultType.MOST_RECENT_EVENTS,
null);
foreach (var persona in this._personas.values)
{
}
foreach (var e in results)
{
- var interaction_type = e.get_subject (0).get_interpretation ();
+ var interaction_type = e.get_subject (0).interpretation;
for (var i = 1; i < e.num_subjects (); i++)
{
- var id = this._get_iid_from_event_metadata (e.get_subject (i).get_uri ());
+ var id = this._get_iid_from_event_metadata (e.get_subject (i).uri);
this._increase_persona_counter (id, interaction_type, e);
}
}
* counters upon interaction changes.*/
if (this._monitor == null)
{
- PtrArray monitor_events = this._get_zeitgeist_event_templates ();
+ GLib.GenericArray<Zeitgeist.Event> monitor_events = this._get_zeitgeist_event_templates ();
this._monitor = new Zeitgeist.Monitor (new Zeitgeist.TimeRange.from_now (),
- (owned) monitor_events);
+ monitor_events);
this._monitor.events_inserted.connect (this._handle_new_interaction);
- this._log.install_monitor (this._monitor);
+ try
+ {
+ this._log.install_monitor (this._monitor);
+ }
+ catch
+ {
+ warning ("Failed to install monitor for Zeitgeist");
+ this._monitor = null;
+ }
}
this._notify_if_is_quiescent ();
#if HAVE_ZEITGEIST
internal void _increase_counter (string id, string interaction_type, Event event)
{
- var timestamp = (uint) (event.get_timestamp () / 1000);
+ var timestamp = (uint) (event.timestamp / 1000);
var converted_datetime = new DateTime.from_unix_utc (timestamp);
- var interpretation = event.get_interpretation ();
+ var interpretation = event.interpretation;
/* Only count send/receive for IM interactions */
- if (interaction_type == Zeitgeist.NMO_IMMESSAGE &&
- (interpretation == Zeitgeist.ZG_SEND_EVENT ||
- interpretation == Zeitgeist.ZG_RECEIVE_EVENT))
+ if (interaction_type == Zeitgeist.NMO.IMMESSAGE &&
+ (interpretation == Zeitgeist.ZG.SEND_EVENT ||
+ interpretation == Zeitgeist.ZG.RECEIVE_EVENT))
{
this._im_interaction_count++;
this.notify_property ("im-interaction-count");
id, this._im_interaction_count, this._last_im_interaction_datetime.format ("%H %M %S - %d %m %y"));
}
/* Only count successful call for call interactions */
- else if (interaction_type == Zeitgeist.NFO_AUDIO &&
- interpretation == Zeitgeist.ZG_LEAVE_EVENT)
+ else if (interaction_type == Zeitgeist.NFO.AUDIO &&
+ interpretation == Zeitgeist.ZG.LEAVE_EVENT)
{
this._call_interaction_count++;
this.notify_property ("call-interaction-count");
TRACKER_SPARQL_REQUIRED=0.15.2
EBOOK_REQUIRED=3.8.1
EDATASERVER_REQUIRED=3.5.3.1
-ZEITGEIST_REQUIRED=0.3.14
+ZEITGEIST_REQUIRED=0.9.14
GEE_REQUIRED=0.8.4
AC_SUBST([TRACKER_SPARQL_MAJOR])
case "x$enable_zeitgeist" in
xyes)
AS_IF([test x$enable_telepathy_backend = xyes],
- [PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-1.0 >= $ZEITGEIST_REQUIRED],
+ [PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-2.0 >= $ZEITGEIST_REQUIRED],
,
[AC_MSG_ERROR([Zeitgeist support requires Zeitgeist development package])])])
have_zeitgeist=yes
;;
xauto)
AS_IF([test x$enable_telepathy_backend = xyes],
- [PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-1.0 >= $ZEITGEIST_REQUIRED],
+ [PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-2.0 >= $ZEITGEIST_REQUIRED],
have_zeitgeist="yes",have_zeitgeist="no")],
[have_zeitgeist=no])
;;
AS_IF([test "x$have_zeitgeist" == "xyes"], [
ZEITGEIST_VALAFLAGS="-D HAVE_ZEITGEIST"
AC_SUBST([ZEITGEIST_VALAFLAGS])
- ZEITGEIST_PKG="--pkg zeitgeist-1.0"
+ ZEITGEIST_PKG="--pkg zeitgeist-2.0"
AC_SUBST([ZEITGEIST_PKG])
])
AS_IF([test x$enable_telepathy_backend = xyes], [
VALA_CHECK_PACKAGES([telepathy-glib])
AS_IF([test "x$have_zeitgeist" == "xyes"], [
- VALA_CHECK_PACKAGES([zeitgeist-1.0])
+ VALA_CHECK_PACKAGES([zeitgeist-2.0])
])
])