public override void CheckRequest() { base.CheckRequest(); if (_errorCode != ChatError.NoError) { return; } if (_session.UserInfo.JoinedChannels.Count == 0) { _errorCode = ChatError.IRCError; _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName); return; } if (!_session.UserInfo.GetJoinedChannelByName(_cmd.ChannelName, out _channel)) { _errorCode = ChatError.IRCError; _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName); return; } if (!_channel.GetChannelUserBySession(_session, out _user)) { _errorCode = ChatError.Parse; _sendingBuffer = ChatIRCError.BuildNoSuchNickError(); return; } }
protected override void BuildErrorResponse() { base.BuildErrorResponse(); switch (_errorCode) { case ChatError.NoSuchChannel: _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_request.ChannelName); break; case ChatError.NoSuchNick: _sendingBuffer = ChatIRCError.BuildNoSuchNickError(); break; } }
public override void CheckRequest() { base.CheckRequest(); //can not find any user if (!_channel.GetChannelUserBySession(_session, out _user)) { _errorCode = ChatError.IRCError; _sendingBuffer = ChatIRCError.BuildNoSuchNickError(); return; } if (!ChatChannelManager.GetChannel(_cmd.ChannelName, out _channel)) { _errorCode = ChatError.IRCError; _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName); } }
private void GetChannelAndUser() { if (_session.UserInfo.JoinedChannels.Count == 0) { _errorCode = ChatError.IRCError; _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName); return; } if (!_session.UserInfo.GetJoinedChannelByName(_cmd.ChannelName, out _channel)) { _errorCode = ChatError.IRCError; _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName); return; } if (!_channel.GetChannelUserBySession(_session, out _user)) { _errorCode = ChatError.Parse; _sendingBuffer = ChatIRCError.BuildNoSuchNickError(); return; } }