protected virtual void OnPublicActionReceived(User user, string channelName, string Action) { var publicActionReceived = PublicActionReceived; if (publicActionReceived != null) publicActionReceived(this, new PublicMessageReceivedEventArgs(user, channelName, Action)); }
protected virtual void OnPrivateActionReceived(User user, string Action) { var privateActionReceived = PrivateActionReceived; if (privateActionReceived != null) privateActionReceived(this, new PrivateMessageReceivedEventArgs(user, Action)); }
public IUserToken RetrieveToken(User user) { IUserToken token; using (_mutex.AquireReadLock()) { token = CreateUserToken(user); } return token; }
public void HandleSingleTargetMessage(User user, string message) { IUserToken userToken = UserTokenCache.RetrieveToken(user); AuthToken authToken = AuthHandler.Authenticate(userToken); Request request = new Request { RequestFrom = authToken, Channel = null, Nick = user.NickName, RequestType = RequestType.Private, Message = message }; CommunicationManager.HandleRequestReceived(request); }
public void HandleMultiTargetAction(User user, string channel, string message) { var userToken = UserTokenCache.RetrieveToken(user); var authToken = AuthHandler.Authenticate(userToken); var request = new Request { RequestFrom = authToken, Channel = channel, Nick = user.NickName, RequestSourceType = RequestSourceType.Public, RequestType = Communications.RequestType.Action, Addressee = user.NickName, Message = message }; CommunicationManager.HandleRequestReceived(request); }
public PublicMessageReceivedEventArgs(User user, string channelName, string message) { User = user; ChannelName = channelName; Message = message; }
void IrcClient_PrivateMessageReceived(object sender, IrcMessageEventArgs e) { var sourceUser = (IrcUser)e.Source; var user = new User { NickName = sourceUser.NickName, HostName = sourceUser.HostName }; OnPrivateMessageReceived(user, e.Text); }
void _ctcpClient_ActionReceived(object sender, CtcpMessageEventArgs e) { var source = e.Source as IrcUser; if (source != null) { var sourceChannel = sender as IrcChannel; if (sourceChannel != null) { var user = new User { NickName = source.NickName, HostName = source.HostName }; OnPublicActionReceived(user, sourceChannel.Name, e.Text); } else { var user = new User { NickName = source.NickName, HostName = source.HostName }; OnPrivateActionReceived(user, e.Text); } } }
public PrivateMessageReceivedEventArgs(User user, string message) { this.User = user; this.Message = message; }
void IrcClient_PublicMessageReceived(object sender, IrcMessageEventArgs e) { var sourceChannel = (IrcChannel)sender; var source = e.Source as IrcUser; if (source != null) { if(sourceChannel != null) { var sourceUser = source; var user = new User { NickName = sourceUser.NickName, HostName = sourceUser.HostName }; if (e.Text.TrimStart().StartsWith("ACTION ")) { string message = e.Text.Substring(8); message = message.Substring(0, message.Length-1); OnPublicActionReceived(user, sourceChannel.Name, message); } else { OnPublicMessageReceived(user, sourceChannel.Name, e.Text); } } } }
protected virtual void OnPrivateMessageReceived(User user, string message) { EventHandler<PrivateMessageReceivedEventArgs> privateMessageReceived = this.PrivateMessageReceived; if (privateMessageReceived != null) privateMessageReceived(this, new PrivateMessageReceivedEventArgs(user, message)); }
void _ircClient_OnQueryMessage(object sender, SIRC4N.IrcEventArgs e) { var user = new User { NickName = e.Data.Nick, HostName = e.Data.Host }; OnPrivateMessageReceived(user, e.Data.Message); }
private static IUserToken CreateUserToken(User user) { return new IrcUserToken(user.NickName, user.HostName); }
protected virtual void OnPublicMessageReceived(User user, string channelName, string message) { EventHandler<PublicMessageReceivedEventArgs> publicMessageReceived = this.PublicMessageReceived; if (publicMessageReceived != null) publicMessageReceived(this, new PublicMessageReceivedEventArgs(user, channelName, message)); }
void Listener_OnPublic(UserInfo userInfo, string channel, string message) { ManualResetEventSlim finishedEvent = new ManualResetEventSlim(); new Thread(() => { var user = new User { NickName = userInfo.Nick, HostName = userInfo.Hostname }; OnPublicMessageReceived(user, channel, message); finishedEvent.Set(); }) { IsBackground = true }.Start(); finishedEvent.Wait(); }
void IrcClient_PublicMessageReceived(object sender, IrcMessageEventArgs e) { var sourceChannel = (IrcChannel)sender; if (e.Source is IrcUser) { var sourceUser = (IrcUser)e.Source; var user = new User { NickName = sourceUser.NickName, HostName = sourceUser.HostName }; OnPublicMessageReceived(user, sourceChannel.Name, e.Text); } }
public PublicMessageReceivedEventArgs(User user, string channelName, string message) { this.User = user; this.ChannelName = channelName; this.Message = message; }
public void InvalidateToken(User user) { InvalidateToken(user.NickName); }
void _ircClient_OnChannelMessage(object sender, SIRC4N.IrcEventArgs e) { var user = new User { NickName = e.Data.Nick, HostName = e.Data.Host }; OnPublicMessageReceived(user, e.Data.Channel, e.Data.Message); }
void _ircClient_OnQueryAction(object sender, SIRC4N.ActionEventArgs e) { var user = new User { NickName = e.Data.Nick, HostName = e.Data.Host }; OnPrivateActionReceived(user, e.Data.Message.Substring(8, e.Data.Message.Length - 9)); }
void Listener_OnPrivateAction(UserInfo userInfo, string message) { var finishedEvent = new ManualResetEventSlim(); new Thread(() => { var user = new User { NickName = userInfo.Nick, HostName = userInfo.Hostname }; OnPrivateActionReceived(user, message); finishedEvent.Set(); }) { IsBackground = true }.Start(); finishedEvent.Wait(); }