Esempio n. 1
0
        private async Task Process(ChangeTopic changeTopic)
        {
            Channel chan;

            if (JoinedChannels.TryGetValue(changeTopic.ChannelName, out chan))
            {
                chan.Topic = changeTopic.Topic;
            }
            ChannelTopicChanged(this, changeTopic);
        }
Esempio n. 2
0
        private async Task Process(ChannelUserRemoved arg)
        {
            Channel chan;

            if (JoinedChannels.TryGetValue(arg.ChannelName, out chan))
            {
                User org;
                if (chan.Users.TryRemove(arg.UserName, out org))
                {
                    if (arg.UserName == UserName)
                    {
                        ChannelLeft(this, chan);
                    }
                    ChannelUserRemoved(this, new ChannelUserRemovedInfo()
                    {
                        Channel = chan, User = org
                    });
                }
            }
        }
Esempio n. 3
0
        private async Task Process(ChannelUserAdded arg)
        {
            Channel chan;

            if (JoinedChannels.TryGetValue(arg.ChannelName, out chan))
            {
                if (!chan.Users.ContainsKey(arg.UserName))
                {
                    User user;
                    if (ExistingUsers.TryGetValue(arg.UserName, out user))
                    {
                        chan.Users[arg.UserName] = user;
                        ChannelUserAdded(this, new ChannelUserInfo()
                        {
                            Channel = chan, Users = new List <User>()
                            {
                                user
                            }
                        });
                    }
                }
            }
        }