Example #1
0
        public static List <FriendInfo> FriendList(SFriendListResult friendListResult)
        {
            var data = friendListResult;

            if (data == null)
            {
                return(null);
            }

            if (data.result.code != ResultCode.OK)
            {
                return(null);
            }

            return(data.info);
        }
Example #2
0
        public static bool IsFriend(SFriendListResult friendListResult, string username)
        {
            if (string.IsNullOrEmpty(username))
            {
                return(false);
            }

            var friendList = FriendList(friendListResult);

            if (friendList == null)
            {
                return(false);
            }

            for (int i = 0; i < friendList.Count; i++)
            {
                if (friendList[i].username == username)
                {
                    return(true);
                }
            }

            return(false);
        }