From 98d2c4d220d74d594426160b445848eeef768ecf Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Wed, 5 Jun 2019 11:44:33 +0100 Subject: [PATCH] [REORG] --- src/Yavsc.Server/Constants.cs | 3 +++ src/Yavsc/Hubs/ChatHub.cs | 11 +---------- src/Yavsc/Hubs/ChatRoomInfo.cs | 35 ++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 src/Yavsc/Hubs/ChatRoomInfo.cs diff --git a/src/Yavsc.Server/Constants.cs b/src/Yavsc.Server/Constants.cs index b3f39e47..b1327e25 100644 --- a/src/Yavsc.Server/Constants.cs +++ b/src/Yavsc.Server/Constants.cs @@ -60,9 +60,12 @@ namespace Yavsc public const string HubGroupAuthenticated = "authenticated"; public const string HubGroupAnonymous = "anonymous"; public const string HubGroupCops= "cops"; + public const string HubGroupRomsPrefix = "room_"; public const int MaxChanelName = 255; + public const string HubGroupFollowingPrefix = "fol "; public const string AnonymousUserNamePrefix = "?"; public const string KeyParamChatUserName = "username"; + public const string LabAuthChatUser = "Authenticated chat user"; } } diff --git a/src/Yavsc/Hubs/ChatHub.cs b/src/Yavsc/Hubs/ChatHub.cs index 56af864d..8ba99055 100644 --- a/src/Yavsc/Hubs/ChatHub.cs +++ b/src/Yavsc/Hubs/ChatHub.cs @@ -21,7 +21,6 @@ using System; using System.Collections.Concurrent; -using System.Collections.Generic; using Microsoft.AspNet.SignalR; using Microsoft.Data.Entity; using Microsoft.Extensions.DependencyInjection; @@ -35,7 +34,7 @@ namespace Yavsc using Models; using Models.Chat; - public class ChatHub : Hub, IDisposable + public partial class ChatHub : Hub, IDisposable { ApplicationDbContext _dbContext; private IStringLocalizer _localizer; @@ -185,14 +184,6 @@ namespace Yavsc return base.OnReconnected(); } - - public class ChatRoomInfo - { - public string Name; - public Dictionary Users = new Dictionary(); - public string Topic; - } - public void Nick(string nickName) { var candidate = "?" + nickName; diff --git a/src/Yavsc/Hubs/ChatRoomInfo.cs b/src/Yavsc/Hubs/ChatRoomInfo.cs new file mode 100644 index 00000000..ddad624b --- /dev/null +++ b/src/Yavsc/Hubs/ChatRoomInfo.cs @@ -0,0 +1,35 @@ +// +// ChatHub.cs +// +// Author: +// Paul Schneider +// +// 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 . + +using System.Collections.Generic; + +namespace Yavsc +{ + public partial class ChatHub + { + public class ChatRoomInfo + { + public string Name; + public Dictionary Users = new Dictionary(); + public string Topic; + } + } +}