Esempio n. 1
0
        public async Task SendRequest(string toId, string userName)
        {
            if (!IsFriends(toId, Context.User.Identity.GetUserId()))
            {
                FriendRequest req = new FriendRequest
                {
                    FromId = Context.User.Identity.GetUserId(),
                    ToId   = toId,
                };
                _friendManager.SendRequest(req);
                var reqId = _friendManager.GetRequestId(req.FromId, req.ToId);
                await ShowFriends(null);

                await Clients.Client(GetUserConId(toId)).sendRequest(req.FromId, req.ToId, reqId, Context.User.Identity.Name);
            }
        }