2 * $Id: IrcUser.cs 198 2005-06-08 16:50:11Z meebey $
3 * $URL: svn://svn.qnetp.net/smartirc/SmartIrc4net/tags/0.4.0/src/IrcClient/IrcUser.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 using System
.Collections
.Specialized
;
31 namespace Meebey
.SmartIrc4net
34 /// This class manages the user information.
37 /// only used with channel sync
38 /// <seealso cref="IrcClient.ActiveChannelSyncing">
39 /// IrcClient.ActiveChannelSyncing
42 /// <threadsafety static="true" instance="true" />
45 private IrcClient _IrcClient
;
46 private string _Nick
= null;
47 private string _Ident
= null;
48 private string _Host
= null;
49 private string _Realname
= null;
50 private bool _IsIrcOp
= false;
51 private bool _IsAway
= false;
52 private string _Server
= null;
53 private int _HopCount
= -1;
55 internal IrcUser(string nickname
, IrcClient ircclient
)
57 _IrcClient
= ircclient
;
64 Logger
.ChannelSyncing
.Debug("IrcUser ("+Nick
+") destroyed");
69 /// Gets or sets the nickname of the user.
72 /// Do _not_ set this value, it will break channel sync!
84 /// Gets or sets the identity (username) of the user which is used by some IRC networks for authentication.
87 /// Do _not_ set this value, it will break channel sync!
99 /// Gets or sets the hostname of the user.
102 /// Do _not_ set this value, it will break channel sync!
114 /// Gets or sets the supposed real name of the user.
117 /// Do _not_ set this value, it will break channel sync!
119 public string Realname
{
129 /// Gets or sets the server operator status of the user
132 /// Do _not_ set this value, it will break channel sync!
134 public bool IsIrcOp
{
144 /// Gets or sets away status of the user
147 /// Do _not_ set this value, it will break channel sync!
159 /// Gets or sets the server the user is connected to
162 /// Do _not_ set this value, it will break channel sync!
164 public string Server
{
174 /// Gets or sets the count of hops between you and the user's server
177 /// Do _not_ set this value, it will break channel sync!
179 public int HopCount
{
189 /// Gets the list of channels the user has joined
191 public string[] JoinedChannels
{
195 string[] channels
= _IrcClient
.GetChannels();
196 StringCollection joinedchannels
= new StringCollection();
197 foreach (string channelname
in channels
) {
198 channel
= _IrcClient
.GetChannel(channelname
);
199 if (channel
.UnsafeUsers
.ContainsKey(_Nick
)) {
200 joinedchannels
.Add(channelname
);
204 result
= new string[joinedchannels
.Count
];
205 joinedchannels
.CopyTo(result
, 0);
207 //return joinedchannels;