private void OnIALUserDataAwayOnly(IRCConnection connection, string nick, bool away, string awayMessage) { if (!connection.IsFullyConnected) return; if (connection.ServerSetting.StatusModes == null) return; //for (int i = 0; i < connection.ServerSetting.StatusModes[1].Length; i++) // nick = nick.Replace(connection.ServerSetting.StatusModes[1][i].ToString(), string.Empty); for (int i = 0; i < connection.ServerSetting.StatusModes[1].Length; i++) if (nick.StartsWith(connection.ServerSetting.StatusModes[1][i].ToString())) nick = nick.Substring(1); InternalAddressList ial = new InternalAddressList(nick, away, awayMessage); if (!connection.ServerSetting.IAL.ContainsKey(nick)) { connection.ServerSetting.IAL.Add(nick, ial); } else { ((InternalAddressList)connection.ServerSetting.IAL[nick]).AwayStatus = away; ((InternalAddressList)connection.ServerSetting.IAL[nick]).AwayMessage = awayMessage; } //redraw the current window if (CurrentWindowStyle == IceTabPage.WindowType.Channel) { if (CurrentWindow.NickExists(nick)) if (CurrentWindow == CurrentWindow) nickList.RefreshList(CurrentWindow); } }
/// <summary> /// Received the full host for a userreply /// </summary> /// <param name="connection">Which Connection it came from</param> /// <param name="fullhost">The full user host Nick+=Ident@Host</param> private void OnUserHostReply(IRCConnection connection, string fullhost) { string host = fullhost.Substring(fullhost.IndexOf('+') + 1); string nick = ""; if (fullhost.IndexOf('*') > -1) nick = fullhost.Substring(0, fullhost.IndexOf('*')); else nick = fullhost.Substring(0, fullhost.IndexOf('=')); //update the internal addresslist and check for user in all channels InternalAddressList ial = new InternalAddressList(nick, host, ""); if (!connection.ServerSetting.IAL.ContainsKey(nick)) connection.ServerSetting.IAL.Add(nick, ial); else ((InternalAddressList)connection.ServerSetting.IAL[nick]).Host = host; }
private void OnIALUserDataAway(IRCConnection connection, string nick, string host, string channel, bool away, string awayMessage) { //internal addresslist userdata try { if (!connection.IsFullyConnected) return; if (connection.ServerSetting.StatusModes == null) return; //for (int i = 0; i < connection.ServerSetting.StatusModes[1].Length; i++) // nick = nick.Replace(connection.ServerSetting.StatusModes[1][i].ToString(), string.Empty); for (int i = 0; i < connection.ServerSetting.StatusModes[1].Length; i++) if (nick.StartsWith(connection.ServerSetting.StatusModes[1][i].ToString())) nick = nick.Substring(1); InternalAddressList ial = new InternalAddressList(nick, host, channel); if (!connection.ServerSetting.IAL.ContainsKey(nick)) { connection.ServerSetting.IAL.Add(nick, ial); } else { if (channel.Length > 0) ((InternalAddressList)connection.ServerSetting.IAL[nick]).AddChannel(channel); if (host.Length > 0) ((InternalAddressList)connection.ServerSetting.IAL[nick]).Host = host; ((InternalAddressList)connection.ServerSetting.IAL[nick]).AwayStatus = away; ((InternalAddressList)connection.ServerSetting.IAL[nick]).AwayMessage = awayMessage; } } catch (Exception e) { WriteErrorFile(connection, "OnIALUserDataAway:" + nick, e); } }