Escape on setting JID instead of getting JID.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@5382 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2006-09-15 20:53:18 +00:00 committed by matt
parent 41a5399c39
commit edd7df6799
1 changed files with 6 additions and 4 deletions

View File

@ -112,7 +112,7 @@ public abstract class Packet {
* value has not been set. * value has not been set.
*/ */
public String getTo() { public String getTo() {
return StringUtils.escapeJID(to); return to;
} }
/** /**
@ -122,7 +122,8 @@ public abstract class Packet {
* @param to who the packet is being sent to. * @param to who the packet is being sent to.
*/ */
public void setTo(String to) { public void setTo(String to) {
this.to = to; // Use escaped version of the JID in case the user included invalid characters.
this.to = StringUtils.escapeJID(to);
} }
/** /**
@ -134,7 +135,7 @@ public abstract class Packet {
* valud has not been set. * valud has not been set.
*/ */
public String getFrom() { public String getFrom() {
return StringUtils.escapeJID(from); return from;
} }
/** /**
@ -145,7 +146,8 @@ public abstract class Packet {
* @param from who the packet is being sent to. * @param from who the packet is being sent to.
*/ */
public void setFrom(String from) { public void setFrom(String from) {
this.from = from; // Use escaped version of the JID in case the user included invalid characters.
this.from = StringUtils.escapeJID(from);
} }
/** /**