public static SuggestedFriend ToSuggestedFriend(this THSuggestedFriend suggestedFriend)
 {
     return(new SuggestedFriend(
                publicProperties: suggestedFriend.User.PublicProperties,
                id: suggestedFriend.User.Id,
                displayName: suggestedFriend.User.DisplayName,
                avatarUrl: suggestedFriend.User.AvatarUrl,
                identities: IdentitiesToDictionary(suggestedFriend.User.Identities),
                mutualFriendsCount: suggestedFriend.MutualFriends
                ));
 }
Ejemplo n.º 2
0
        public static SuggestedFriend ToSuggestedFriend(this THSuggestedFriend suggestedFriend)
        {
            var user = suggestedFriend.User;

            return(new SuggestedFriend {
                PublicProperties = user.PublicProperties,
                Id = user.Id,
                Identities = IdentitiesToDictionary(user.Identities),
                Verified = false,
                AvatarUrl = user.AvatarUrl,
                DisplayName = user.DisplayName,
                MutualFriendsCount = suggestedFriend.MutualFriends
            });
        }
Ejemplo n.º 3
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.List)
                        {
                            {
                                Users = new List <THSuggestedFriend>();
                                TList _list47 = iprot.ReadListBegin();
                                for (int _i48 = 0; _i48 < _list47.Count; ++_i48)
                                {
                                    THSuggestedFriend _elem49;
                                    _elem49 = new THSuggestedFriend();
                                    _elem49.Read(iprot);
                                    Users.Add(_elem49);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            NextCursor = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }