Commit 1c05da23 authored by Philip Withnall's avatar Philip Withnall

telepathy: Fix bus watching by multiple Tpf.PersonaStore instances

The bus needs to be watched by all Tpf.PersonaStores which are connected to
the Logger instance, so that they all get the ‘invalidated’ signal.
parent 30c4ca65
......@@ -45,6 +45,7 @@ private interface LoggerIface : Object
internal class Logger : GLib.Object
{
private static DBusConnection _dbus_conn;
private static LoggerIface _logger;
private uint _logger_watch_id;
......@@ -93,13 +94,14 @@ internal class Logger : GLib.Object
return retval;
}
this._logger_watch_id = Bus.watch_name_on_connection (dbus_conn,
"org.freedesktop.Telepathy.Logger", BusNameWatcherFlags.NONE,
null, this._logger_vanished);
Logger._dbus_conn = dbus_conn;
retval = true;
}
this._logger_watch_id = Bus.watch_name_on_connection (Logger._dbus_conn,
"org.freedesktop.Telepathy.Logger", BusNameWatcherFlags.NONE,
null, this._logger_vanished);
Logger._logger.favourite_contacts_changed.connect ((ap, a, r) =>
{
if (ap != this._account_path)
......@@ -115,6 +117,7 @@ internal class Logger : GLib.Object
{
/* The logger has vanished on the bus, so it and we are no longer valid */
Logger._logger = null;
Logger._dbus_conn = null;
this.invalidated ();
}
......
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