From 3171bc1ff4e32fd28cd7fcdd44f183278a771c49 Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Mon, 2 Feb 2009 22:03:26 +0000 Subject: [PATCH] Change the behaviour of the NameUpdater to play nicely with Name implementations where equal() does not depend on display name. Write cumbersome TODO comment. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5648 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/crowd/data/OccupantInfo.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/crowd/data/OccupantInfo.java b/src/java/com/threerings/crowd/data/OccupantInfo.java index 1264fe093..eab434db6 100644 --- a/src/java/com/threerings/crowd/data/OccupantInfo.java +++ b/src/java/com/threerings/crowd/data/OccupantInfo.java @@ -74,7 +74,12 @@ public class OccupantInfo extends SimpleStreamableObject _name = name; } public boolean update (OccupantInfo info) { - if (info.username.equals(_name)) { + // The behaviour here used to be to compare the names themselves against one another + // using equals(), but was changed to accommodate the idea of display name changing + // while fundamental identity stays the same -- case in point, Whirled's MemberName + // bases equal()ity on an integer identifier. TODO: investigate whether this is a + // reasonable assumption and whether the behaviour change might break something. + if (info.username.getNormal().equals(_name.getNormal())) { return false; } info.username = _name;