1 //////////////////////////////////////////////////////////////////////////////
2 // dexterIM - Instant Messaging Framework
3 // Copyright (C) 2003 Christoph Walcher
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 //////////////////////////////////////////////////////////////////////////////
19 package net.sf.dexterim.msn.message;
20
21 import net.sf.dexterim.msn.MsnConnection;
22
23 /***
24 *@author Christoph Walcher
25 */
26 public class ChangeScreenNameMessage extends SingleLineMessage {
27 private String nick;
28 private String account;
29
30 /***
31 * Creates a new instance of RemoveFromListMessage
32 */
33 public ChangeScreenNameMessage() {
34 }
35
36 /***
37 * Gets the messageCommand attribute of the ChangeScreenNameMessage object
38 *
39 *@return The messageCommand value
40 */
41 public String getMessageCommand() {
42 return MsnMessageFactory.CMD_CHANGE_SCREEN_NAME;
43 }
44
45 /***
46 * Getter for property account.
47 *
48 *@return Value of property account.
49 */
50 public java.lang.String getAccount() {
51 return account;
52 }
53
54 /***
55 * Getter for property nick.
56 *
57 *@return Value of property nick.
58 */
59 public java.lang.String getNick() {
60 return nick;
61 }
62
63 /***
64 * Adds a feature to the Line attribute of the ChangeScreenNameMessage
65 * object
66 *
67 *@param line The feature to be added to the Line attribute
68 *@return Description of the Return Value
69 */
70 public MsnMessage addLine(String line) {
71 // Parse Messages like
72 // REA 25 115 example@passport.com My%20New%20Name
73 java.util.StringTokenizer st = new java.util.StringTokenizer(line);
74
75 st.nextToken();
76
77 // skip CMD_CHANGE_SCREEN_NAME
78 st.nextToken();
79
80 // skip TransactionID
81 st.nextToken();
82
83 // Version number of ContactList
84 account = st.nextToken();
85 nick =
86 net.sf.dexterim.msn.util.SpecialCharacters.getInstance().decode(
87 st.nextToken(),
88 true);
89
90 return this;
91 }
92
93 /* (non-Javadoc)
94 * @see net.sf.dexterim.msn.message.MsnMessage#process(net.sf.dexterim.msn.MsnConnection)
95 */
96 public void process(MsnConnection connection) {
97 // TODO Auto-generated method stub
98
99 }
100 }