Hello community, here is the log from the commit of package folks for openSUSE:Factory checked in at 2014-02-02 07:33:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/folks (Old) and /work/SRC/openSUSE:Factory/.folks.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "folks" Changes: -------- --- /work/SRC/openSUSE:Factory/folks/folks.changes 2013-11-24 11:27:00.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.folks.new/folks.changes 2014-02-02 07:33:59.000000000 +0100 @@ -1,0 +2,6 @@ +Mon Jan 27 12:52:07 CST 2014 - federico@suse.com + +- Added folks-bnc855848-individual-crash.patch to fix bnc#855848. + Empathy would crash when using IRC channels; this fixes the crash. + +------------------------------------------------------------------- New: ---- folks-bnc855848-individual-crash.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ folks.spec ++++++ --- /var/tmp/diff_new_pack.YBhBTH/_old 2014-02-02 07:33:59.000000000 +0100 +++ /var/tmp/diff_new_pack.YBhBTH/_new 2014-02-02 07:33:59.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package folks # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,6 +27,8 @@ Group: System/Libraries Url: http://telepathy.freedesktop.org/wiki/Folks Source: http://download.gnome.org/sources/folks/0.9/%{name}-%{version}.tar.xz +# PATCH-FIX-UPSTREAM: folks-bnc855848-individual-crash.patch bnc855848 federico@suse.com - Fix crash when using IRC channels +Patch1: folks-bnc855848-individual-crash.patch BuildRequires: gobject-introspection-devel BuildRequires: intltool >= 0.50.0 BuildRequires: readline-devel @@ -168,6 +170,7 @@ %lang_package %prep %setup -q +%patch1 -p1 %build %configure \ ++++++ folks-bnc855848-individual-crash.patch ++++++ Fix crash when connecting to and using IRC channels. https://bugzilla.redhat.com/show_bug.cgi?id=1031252 diff --git a/folks/individual.vala b/folks/individual.vala index 7b3eccd..5ff00b2 100644 --- a/folks/individual.vala +++ b/folks/individual.vala @@ -231,12 +231,12 @@ public class Folks.Individual : Object, * * @since 0.6.0 */ - public string presence_status { get; set; } + public string presence_status { get; set; default = ""; } /** * {@inheritDoc} */ - public string presence_message { get; set; } + public string presence_message { get; set; default = ""; } /** * {@inheritDoc} @@ -286,8 +286,11 @@ public class Folks.Individual : Object, * instead. For example, if storing references to Individuals who are tagged * in a photo, it may be safer to store the UID of the Persona whose backend * provided the photo (e.g. Facebook). + * + * As a special case, the ID defaults to an empty string when the individual + * has no personas (i.e. if it’s just been constructed). */ - public string id { get; private set; } + public string id { get; private set; default = ""; } /** * Emitted when the last of the Individual's {@link Persona}s has been @@ -1228,14 +1231,41 @@ public class Folks.Individual : Object, private void _persona_notify_cb (Object obj, ParamSpec ps) { - assert (obj is Persona); - assert (ps.name == "individual" || (obj as Persona).individual == this); + var persona = (Persona) obj; /* will abort on failure */ + + /* It should not be possible for two Individuals to be simultaneously + * connected to the same Persona (as _connect_to_persona() will disconnect + * any previous Persona.individual), but warn (rather than asserting) just + * in case, since this is a critical code path. */ + if (ps.name != "individual" && + persona.individual != this && + persona.individual != null) + { + warning ("Notification on property ‘%s’ of Persona %p (‘%s’) where " + + "Persona.individual is %p but was expected to be %p.", + ps.name, persona, persona.uid, persona.individual, this); + return; + } + else if (ps.name == "individual") + { + if (persona.individual != this) + { + /* Remove the notified persona from our set of personas. */ + var remaining_personas = new SmallSet<Persona> (); + remaining_personas.add_all (this._persona_set); + remaining_personas.remove (persona); + + this._set_personas (remaining_personas, null); + } + + return; + } foreach (var notifier in Individual._notifiers) { if (ps.name == notifier.property) { - notifier.notify (this, (!) (obj as Persona), ps); + notifier.notify (this, persona, ps); break; /* assume all entries in notifiers are unique */ } } @@ -2111,8 +2141,17 @@ public class Folks.Individual : Object, }, emit_notification, force_update); } + /* Note: This causes the Persona to be stolen away from its current + * Individual. */ private void _connect_to_persona (Persona persona) { + if (persona.individual != null && persona.individual != this) + { + /* Disconnect the previous Individual. This atomically avoids having + * two Individuals connected to the same Persona simultaneously. */ + persona.individual._disconnect_from_persona (persona, this); + } + persona.individual = this; /* We're interested in most, if not all, signals from a persona, @@ -2863,6 +2902,11 @@ public class Folks.Individual : Object, this.id = Checksum.compute_for_string (ChecksumType.SHA1, ((!) chosen_persona).uid); } + else + { + /* Default if we have no personas. */ + this.id = ""; + } /* Update our aggregated fields and notify the changes */ this._update_fields (); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org