code format
This commit is contained in:
parent
5e4515df58
commit
88ce2f674d
1 changed files with 18 additions and 13 deletions
|
|
@ -129,7 +129,8 @@ namespace Yavsc
|
|||
public override Task OnDisconnected(bool stopCalled)
|
||||
{
|
||||
string userName = Context.User?.Identity.Name;
|
||||
if (userName!=null) {
|
||||
if (userName != null)
|
||||
{
|
||||
var user = _dbContext.Users.FirstOrDefault(u => u.UserName == userName);
|
||||
var userId = user.Id;
|
||||
Clients.Group(Constants.HubGroupFollowingPrefix + userId).notifyuser(NotificationTypes.DisConnected, userName, null);
|
||||
|
|
@ -343,7 +344,11 @@ namespace Yavsc
|
|||
[Authorize]
|
||||
public void SendPV(string userName, string message)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(userName)) return;
|
||||
if (string.IsNullOrWhiteSpace(userName))
|
||||
{
|
||||
Clients.Caller.notifyUser(NotificationTypes.Error, "none!", "specify an user.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (userName[0] != '?')
|
||||
if (!Context.User.IsInRole(Constants.AdminGroupName))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue