--pkg gio-2.0 \
--pkg gee-1.0 \
--pkg telepathy-glib \
+ --pkg zeitgeist-1.0 \
--includedir folks \
--vapi folks-telepathy.vapi \
-H folks/folks-telepathy.h \
$(GLIB_CFLAGS) \
$(GEE_CFLAGS) \
$(TP_GLIB_CFLAGS) \
+ $(ZEITGEIST_CFLAGS) \
$(NULL)
libfolks_telepathy_la_LIBADD = \
$(GLIB_LIBS) \
$(GEE_LIBS) \
$(TP_GLIB_LIBS) \
+ $(ZEITGEIST_LIBS) \
$(top_builddir)/folks/libfolks.la \
$(top_builddir)/folks/libfolks-internal.la \
$(NULL)
-libfolks_telepathy_la_VALAFLAGS += --pkg zeitgeist-1.0
-libfolks_telepathy_la_VALAFLAGS += --define=HAVE_ZEITGEIST
-libfolks_telepathy_la_CFLAGS += $(ZEITGEIST_CFLAGS)
-libfolks_telepathy_la_LIBADD += $(ZEITGEIST_LIBS)
-
# The quoting here is unnecessary but harmless, and has the useful side-effect
# that vim quickfix mode (:make) doesn't interpret the libtool --mode=link
# command as an error message in a bizarrely named file
using Gee;
using TelepathyGLib;
using Folks;
-#if HAVE_ZEITGEIST
using Zeitgeist;
-#endif
extern const string G_LOG_DOMAIN;
extern const string BACKEND_NAME;
private Account _account;
-#if HAVE_ZEITGEIST
private Zeitgeist.Log? _log= null;
private Zeitgeist.Monitor? _monitor = null;
-#endif
/**
* The Telepathy account this store is based upon.
new GLib.GenericArray<TelepathyGLib.Contact> ());
this._got_initial_members = true;
-#if HAVE_ZEITGEIST
this._populate_counters ();
-#endif
this._notify_if_is_quiescent ();
}
return store;
}
-#if HAVE_ZEITGEIST
- private string? _get_iid_from_event_metadata (string? uri)
+ private string? _get_iid_from_event_metadata (string? uri)
{
/* Format a proper id represting a persona in the store.
- * Zeitgeist uses x-telepathy-identifier as a prefix for telepathy, which
+ * Zeitgeist uses x-telepathy-identifier as a prefix for telepathy, which
* is stored as the uri of a subject of an event. */
if (uri == null)
{
var new_uri = uri.replace ("x-telepathy-identifier:", "");
return this.account.protocol + ":" + new_uri;
}
-
+
private void _increase_persona_counter (string? id, string? interaction_type, Event event)
{
/* Check if the persona id and interaction is valid. If so increase the
/* Get all events for this account from Zeitgeist and increase the
* the counters of the personas */
- try
+ try
{
PtrArray events = this._get_zeitgeist_event_templates ();
var results = yield this._log.find_events (new TimeRange.anytime (),
debug ("Failed to fetch events from Zeitgeist");
}
- /* Prepare a monitor and install for this account to populate persona
+ /* Prepare a monitor and install for this account to populate persona
* counters upon interaction changes.*/
if (this._monitor == null)
{
this._notify_if_is_quiescent ();
}
-#endif
}
using GLib;
using TelepathyGLib;
using Folks;
-#if HAVE_ZEITGEIST
using Zeitgeist;
-#endif
/**
* A persona subclass which represents a single instant messaging contact from
return store._ensure_persona_for_contact (contact);
}
-#if HAVE_ZEITGEIST
internal void _increase_counter (string id, string interaction_type, Event event)
{
var timestamp = (uint) (event.get_timestamp () / 1000);
this.notify_property ("call-interaction-count");
if (this._last_call_interaction_datetime == null ||
this._last_call_interaction_datetime.compare (converted_datetime) == -1)
- {
+ {
this._last_call_interaction_datetime = converted_datetime;
this.notify_property ("last-call-interaction-datetime");
}
}
}
- internal void _reset_interaction ()
+ internal void _reset_interaction ()
{
this._call_interaction_count = 0;
this._im_interaction_count = 0;
this._last_call_interaction_datetime = null;
this._last_im_interaction_datetime = null;
}
-#endif
}