This commit is contained in:
2019-06-05 11:44:33 +01:00
parent 73ad8a3d47
commit 98d2c4d220
3 changed files with 39 additions and 10 deletions

View File

@ -60,9 +60,12 @@ namespace Yavsc
public const string HubGroupAuthenticated = "authenticated"; public const string HubGroupAuthenticated = "authenticated";
public const string HubGroupAnonymous = "anonymous"; public const string HubGroupAnonymous = "anonymous";
public const string HubGroupCops= "cops"; public const string HubGroupCops= "cops";
public const string HubGroupRomsPrefix = "room_";
public const int MaxChanelName = 255; public const int MaxChanelName = 255;
public const string HubGroupFollowingPrefix = "fol ";
public const string AnonymousUserNamePrefix = "?"; public const string AnonymousUserNamePrefix = "?";
public const string KeyParamChatUserName = "username"; public const string KeyParamChatUserName = "username";
public const string LabAuthChatUser = "Authenticated chat user";
} }
} }

View File

@ -21,7 +21,6 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic;
using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -35,7 +34,7 @@ namespace Yavsc
using Models; using Models;
using Models.Chat; using Models.Chat;
public class ChatHub : Hub, IDisposable public partial class ChatHub : Hub, IDisposable
{ {
ApplicationDbContext _dbContext; ApplicationDbContext _dbContext;
private IStringLocalizer _localizer; private IStringLocalizer _localizer;
@ -185,14 +184,6 @@ namespace Yavsc
return base.OnReconnected(); return base.OnReconnected();
} }
public class ChatRoomInfo
{
public string Name;
public Dictionary<string, string> Users = new Dictionary<string, string>();
public string Topic;
}
public void Nick(string nickName) public void Nick(string nickName)
{ {
var candidate = "?" + nickName; var candidate = "?" + nickName;

View File

@ -0,0 +1,35 @@
//
// ChatHub.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2016-2019 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System.Collections.Generic;
namespace Yavsc
{
public partial class ChatHub
{
public class ChatRoomInfo
{
public string Name;
public Dictionary<string, string> Users = new Dictionary<string, string>();
public string Topic;
}
}
}