2 * $Id: IrcMessageData.cs 198 2005-06-08 16:50:11Z meebey $
3 * $URL: svn://svn.qnetp.net/smartirc/SmartIrc4net/tags/0.4.0/src/IrcClient/IrcMessageData.cs $
6 * $Date: 2005-06-08 18:50:11 +0200 (Wed, 08 Jun 2005) $
8 * SmartIrc4net - the IRC library for .NET/C# <http://smartirc4net.sf.net>
10 * Copyright (c) 2003-2005 Mirco Bauer <meebey@meebey.net> <http://www.meebey.net>
12 * Full LGPL License: <http://www.gnu.org/licenses/lgpl.txt>
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 namespace Meebey
.SmartIrc4net
32 /// This class contains an IRC message in a parsed form
34 /// <threadsafety static="true" instance="true" />
35 public class IrcMessageData
37 private IrcClient _Irc
;
40 private string _Ident
;
42 private string _Channel
;
43 private string _Message
;
44 private string[] _MessageArray
;
45 private string _RawMessage
;
46 private string[] _RawMessageArray
;
47 private ReceiveType _Type
;
48 private ReplyCode _ReplyCode
;
51 /// Gets the IrcClient object the message originated from
53 public IrcClient Irc
{
60 /// Gets the combined nickname, identity and hostname of the user that sent the message
72 /// Gets the nickname of the user that sent the message
81 /// Gets the identity (username) of the user that sent the message
90 /// Gets the hostname of the user that sent the message
99 /// Gets the channel the message originated from
101 public string Channel
{
110 public string Message
{
117 /// Gets the message as an array of strings (splitted by space)
119 public string[] MessageArray
{
121 return _MessageArray
;
126 /// Gets the raw message sent by the server
128 public string RawMessage
{
135 /// Gets the raw message sent by the server as array of strings (splitted by space)
137 public string[] RawMessageArray
{
139 return _RawMessageArray
;
144 /// Gets the message type
146 public ReceiveType Type
{
153 /// Gets the message reply code
155 public ReplyCode ReplyCode
{
162 /// Constructor to create an instace of IrcMessageData
164 /// <param name="ircclient">IrcClient the message originated from</param>
165 /// <param name="from">combined nickname, identity and host of the user that sent the message (nick!ident@host)</param>
166 /// <param name="nick">nickname of the user that sent the message</param>
167 /// <param name="ident">identity (username) of the userthat sent the message</param>
168 /// <param name="host">hostname of the user that sent the message</param>
169 /// <param name="channel">channel the message originated from</param>
170 /// <param name="message">message</param>
171 /// <param name="rawmessage">raw message sent by the server</param>
172 /// <param name="type">message type</param>
173 /// <param name="replycode">message reply code</param>
174 public IrcMessageData(IrcClient ircclient
, string from, string nick
, string ident
, string host
, string channel
, string message
, string rawmessage
, ReceiveType type
, ReplyCode replycode
)
177 _RawMessage
= rawmessage
;
178 _RawMessageArray
= rawmessage
.Split(new char[] {' '}
);
180 _ReplyCode
= replycode
;
186 if (message
!= null) {
187 // message is optional
189 _MessageArray
= message
.Split(new char[] {' '}
);