summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2011-10-11 21:46:34 (GMT)
committerTravis Reitter <travis.reitter@collabora.co.uk>2011-10-11 21:46:34 (GMT)
commit38b99d5cdbee676dfc382efda3f7dbfa0860f371 (patch)
treeb7b389119ea0da81677a3b6713fd978ca1c428bf
parent0436f69e0cf70e23ee447f3a30df256cddb1cf96 (diff)
downloadfolks-38b99d5cdbee676dfc382efda3f7dbfa0860f371.tar.gz
folks-38b99d5cdbee676dfc382efda3f7dbfa0860f371.tar.xz
Fix our birthday string parsing for Telepathy backend.
-rw-r--r--backends/telepathy/lib/tpf-persona.vala22
-rw-r--r--tests/telepathy/individual-properties.vala4
2 files changed, 15 insertions, 11 deletions
diff --git a/backends/telepathy/lib/tpf-persona.vala b/backends/telepathy/lib/tpf-persona.vala
index ca099cf..227f5ef 100644
--- a/backends/telepathy/lib/tpf-persona.vala
+++ b/backends/telepathy/lib/tpf-persona.vala
@@ -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
diff --git a/tests/telepathy/individual-properties.vala b/tests/telepathy/individual-properties.vala
index d55924d..5bf1771 100644
--- a/tests/telepathy/individual-properties.vala
+++ b/tests/telepathy/individual-properties.vala
@@ -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,