From 6696541c430d53298fab58680e53b1f264f725ab Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Wed, 15 Jan 2003 15:02:29 +0000 Subject: [PATCH] Removed extra fields. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1784 b35dd754-fafc-0310-a699-88a17e54d16e --- .../jivesoftware/smack/packet/Message.java | 71 ++++--------------- 1 file changed, 15 insertions(+), 56 deletions(-) diff --git a/source/org/jivesoftware/smack/packet/Message.java b/source/org/jivesoftware/smack/packet/Message.java index 419ad4a7e..fcbc90edb 100644 --- a/source/org/jivesoftware/smack/packet/Message.java +++ b/source/org/jivesoftware/smack/packet/Message.java @@ -86,8 +86,6 @@ public class Message extends Packet { public static final Type HEADLINE = new Type("headline"); public static final Type ERROR = new Type("error"); - private String sender = null; - private String recipient = null; private Type type = NORMAL; private String subject = null; private String body = null; @@ -103,65 +101,26 @@ public class Message extends Packet { /** * Creates a new "normal" message to the specified recipient. * - * @param recipient the recipient of the message. + * @param to the recipient of the message. */ - public Message(String recipient) { - this.recipient = recipient; + public Message(String to) { + setTo(to); } /** * Creates a new message of the specified type to a recipient. * - * @param recipient the user to send the message to. + * @param to the user to send the message to. * @param type the message type. */ - public Message(String recipient, Type type) { - if (recipient == null || type == null) { + public Message(String to, Type type) { + if (to == null || type == null) { throw new IllegalArgumentException("Parameters cannot be null."); } - this.recipient = recipient; + setTo(to); this.type = type; } - /** - * Returns the sender of the message, or null if the sender has not been set. - * - * @return the sender of the message. - */ - public String getSender() { - return sender; - } - - /** - * Sets the sender of the message. - * - * @param sender the sender of the message. - */ - public void setSender(String sender) { - this.sender = sender; - } - - /** - * Returns the recipient of the message, or null if the recipient has not been set. - * - * @return the recipient of the message. - */ - public String getRecipient() { - return recipient; - } - - /** - * Sets the recipient of the message. - * - * @param recipient the recipient of the message. - */ - public void setRecipient(String recipient) { - if (recipient == null) { - throw new IllegalArgumentException("Recipient cannot be null."); - } - this.recipient = recipient; - } - /** * Returns the type of the message. * @@ -250,11 +209,11 @@ public class Message extends Packet { StringBuffer buf = new StringBuffer(); buf.append("