Exemplo n.º 1
0
        /// <summary>
        /// Gets the number of Buddies in the specified Group.
        /// </summary>
        /// <param name="GroupName">The Group Name to check the number of Buddies.</param>
        /// <returns>Returns the number of Buddies int he specified Group.</returns>
        public static int NumberOfBuddiesInGroup(String GroupName)
        {
            //get the buddy list
            IAccBuddyList bl = accSess.BuddyList;

            //get the group
            IAccGroup grp = bl.GetGroupByName(GroupName);

            //return the number
            return(grp.BuddyCount);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets if the Buddy is Idle. This is necessary because Buddies are not always reported as Idle for some strange AOL known reason.
        /// </summary>
        /// <param name="BuddyName">The Name of the Buddy to check.</param>
        /// <returns>Returns true if the Buddy is Idle, false else.</returns>
        public static void CheckBuddyIdle(String BuddyName)
        {
            //get the buddy list
            IAccBuddyList bl = accSess.BuddyList;

            //get the user
            IAccUser usr = bl.GetBuddyByName(BuddyName);

            //sanity check: null user
            if (usr == null)
            {
                return;
            }

            //request idle
            usr.RequestProperty(AccUserProp.AccUserProp_IdleTime);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the Position of the Group in the BuddyList
        /// </summary>
        /// <param name="GroupName">The name of the Group to get the Position of.</param>
        /// <returns>Returns an int for the position.</returns>
        public static int GroupPosition(String GroupName)
        {
            //get the buddy list
            IAccBuddyList bl = accSess.BuddyList;

            //get the group
            IAccGroup grp = bl.GetGroupByName(GroupName);

            //sanity check: null group
            if (grp == null)
            {
                return(-1);
            }

            //return the position
            return(bl.GetGroupPosition(grp));
        }
Exemplo n.º 4
0
        private static void BuddyStateChanged(IAccUser user, InternalUserStateFlags state)
        {
            //temp buddy list var
            IAccBuddyList bl = accSess.BuddyList;

            //name of user/groups
            String strName = user.Name;

            String[] arrGroups = GetUsersGroupsNames(user);

            switch (state)
            {
            case InternalUserStateFlags.SignedOffline:
                //raise offline event
                if (BuddySignedOffline != null)
                {
                    BuddySignedOffline.Invoke(strName, arrGroups);
                }
                break;

            case InternalUserStateFlags.SignedOnline:
                //raise online event
                if (BuddySignedOnline != null)
                {
                    BuddySignedOnline.Invoke(strName, arrGroups);
                }
                break;

            case InternalUserStateFlags.WentAway:
                //raise away event
                if (BuddyWentAway != null)
                {
                    BuddyWentAway.Invoke(strName, arrGroups);
                }
                break;

            case InternalUserStateFlags.WentIdle:
                //raise idle event
                if (BuddyWentIdle != null)
                {
                    BuddyWentIdle.Invoke(strName, arrGroups);
                }
                break;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Gets the Position of the Buddy in the specified Group.
        /// </summary>
        /// <param name="BuddyName">The Name of the Buddy to get the Position of.</param>
        /// <param name="GroupName">The Name of the Group the specified Buddy belongs to.</param>
        /// <returns>Returns the Position of the specified Buddy.</returns>
        public static int BuddyPosition(String BuddyName, String GroupName)
        {
            //get the buddy list
            IAccBuddyList bl = accSess.BuddyList;

            //get the group
            IAccGroup grp = bl.GetGroupByName(GroupName);

            //get the buddy
            IAccUser usr = bl.GetBuddyByName(BuddyName);

            //sanity check: null group
            if (grp == null)
            {
                return(-1);
            }

            //return the Buddy's position
            return(grp.GetBuddyPosition(usr));
        }