Commit 38b99d5c authored by Travis Reitter's avatar Travis Reitter
Browse files

Fix our birthday string parsing for Telepathy backend.

parent 0436f69e
......@@ -776,15 +776,21 @@ public class Tpf.Persona : Folks.Persona,
if (new_birthday_str != "")
{
var timeval = TimeVal ();
timeval.from_iso8601 (new_birthday_str);
/* work around bgo#661397 by forcing our microseconds to zero */
timeval.tv_usec = 0;
var d = new DateTime.from_timeval_utc (timeval);
if (this._birthday == null ||
(this._birthday != null && !this._birthday.equal (d.to_utc ())))
if (timeval.from_iso8601 (new_birthday_str))
{
this._birthday = d.to_utc ();
this.notify_property ("birthday");
var d = new DateTime.from_timeval_utc (timeval);
if (this._birthday == null ||
(this._birthday != null &&
!this._birthday.equal (d.to_utc ())))
{
this._birthday = d.to_utc ();
this.notify_property ("birthday");
}
}
else
{
warning ("Failed to parse new birthday string '%s'",
new_birthday_str);
}
}
else
......
......@@ -396,9 +396,7 @@ public class IndividualPropertiesTests : Folks.TestCase
var removed = changes.get_keys ();
var timeval = TimeVal ();
timeval.from_iso8601 ("1929-01-11T00:00Z");
/* work around bgo#661397 by forcing our microseconds to zero */
timeval.tv_usec = 0;
timeval.from_iso8601 ("1929-01-11T00:00:00Z");
var new_birthday = new DateTime.from_timeval_utc (timeval);
var new_email_fd = new EmailFieldDetails ("cave@aperturescience.com");
new_email_fd.set_parameter (AbstractFieldDetails.PARAM_TYPE,
......
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