Esempio n. 1
0
        protected void User_OnUserStatus(object sender, UserStatusEventArgs e)
        {
            var usr = (User)sender;

            foreach (string budd in usr.Buddies)
            {
                User buddy = GetUser(budd);

                if (buddy != null)
                {
                    if (buddy.Buddies.Contains(usr.Username))
                    {
                        buddy.SendStatus(e.Username, e.Status);
                    }
                }
            }
        }
Esempio n. 2
0
        protected void User_OnUserMessage(object sender, UserMessageEventArgs e)
        {
            User user = GetUser(e.To);

            if (user != null)
            {
                user.SendUserMessage(e.From, e.Message);
            }
            else
            {
                User from = GetUser(e.From);

                if (from != null)
                {
                    from.SendStatus(e.To, BuddyStatus.Offline);
                }
            }
        }