mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
Refactored: ExternalRepresentationUtils should be the only place where the "CreatorData" field is calculated, to ensure uniformity
Resolves http://opensimulator.org/mantis/view.php?id=6933
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -161,7 +161,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
if (!hasCreatorData && creator != null)
|
||||
{
|
||||
XmlElement creatorData = doc.CreateElement("CreatorData");
|
||||
creatorData.InnerText = homeURL + ";" + creator.FirstName + " " + creator.LastName;
|
||||
creatorData.InnerText = CalcCreatorData(homeURL, creator.FirstName + " " + creator.LastName);
|
||||
sop.AppendChild(creatorData);
|
||||
}
|
||||
}
|
||||
@@ -172,5 +172,15 @@ namespace OpenSim.Framework.Serialization.External
|
||||
return wr.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string CalcCreatorData(string homeURL, string name)
|
||||
{
|
||||
return homeURL + ";" + name;
|
||||
}
|
||||
|
||||
internal static string CalcCreatorData(string homeURL, UUID uuid, string name)
|
||||
{
|
||||
return homeURL + "/" + uuid + ";" + name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||
UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid);
|
||||
if (account != null)
|
||||
{
|
||||
writer.WriteElementString("CreatorData", (string)options["home"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName);
|
||||
string creatorData = ExternalRepresentationUtils.CalcCreatorData((string)options["home"], inventoryItem.CreatorIdAsUuid, account.FirstName + " " + account.LastName);
|
||||
writer.WriteElementString("CreatorData", creatorData);
|
||||
}
|
||||
writer.WriteElementString("CreatorID", inventoryItem.CreatorId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user