Chat rooms
This commit is contained in:
parent
f59d3b4b22
commit
6ad9b82174
23 changed files with 3641 additions and 341 deletions
12
src/Yavsc.Server/ChatUserFlags.cs
Normal file
12
src/Yavsc.Server/ChatUserFlags.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// Chat User Flags
|
||||
/// </summary>
|
||||
public enum ChatUserFlags : byte
|
||||
{
|
||||
away = 1,
|
||||
invisible = 2,
|
||||
cop = 4
|
||||
}
|
||||
}
|
||||
|
|
@ -61,9 +61,8 @@ namespace Yavsc
|
|||
public const string HubGroupAnonymous = "anonymous";
|
||||
public const string HubGroupCops= "cops";
|
||||
public const int MaxChanelName = 255;
|
||||
}
|
||||
public static class NotificationTypes {
|
||||
public const string Connected = "connected";
|
||||
public const string DisConnected = "disconnected";
|
||||
|
||||
public const string AnonymousUserNamePrefix = "?";
|
||||
public const string KeyParamChatUserName = "username";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
6
src/Yavsc.Server/ErrorMessages.cs
Normal file
6
src/Yavsc.Server/ErrorMessages.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
namespace Yavsc
|
||||
{
|
||||
public static class ErrorMessages {
|
||||
public const string ContactRefused = "contact refused";
|
||||
}
|
||||
}
|
||||
|
|
@ -15,8 +15,11 @@ namespace Yavsc.Models.Access
|
|||
[Required]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId"),JsonIgnore]
|
||||
[ForeignKey("OwnerId"), JsonIgnore]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[ForeignKey("UserId"), JsonIgnore]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Abstract.Chat;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatRoom: IChatRoom<ChatRoomAccess>
|
||||
public class ChatRoom: IChatRoom<ChatRoomAccess>, IBaseTrackedEntity
|
||||
{
|
||||
public string Topic { get; set; }
|
||||
|
||||
|
|
@ -16,11 +18,17 @@ namespace Yavsc.Models.Chat
|
|||
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
[ForeignKey("OwnerId")][JsonIgnore]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[InverseProperty("Room")]
|
||||
[InverseProperty("Room")][JsonIgnore]
|
||||
public virtual List<ChatRoomAccess> Moderation { get; set; }
|
||||
public DateTime LatestJoinPart { get; set;}
|
||||
|
||||
public DateTime DateCreated { get; set; }
|
||||
|
||||
public string UserCreated { get; set; }
|
||||
public DateTime DateModified { get; set;}
|
||||
public string UserModified { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -25,8 +25,6 @@ namespace Yavsc.Models.Chat
|
|||
get; set;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
}
|
||||
|
|
|
|||
13
src/Yavsc.Server/NotificationTypes.cs
Normal file
13
src/Yavsc.Server/NotificationTypes.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
namespace Yavsc
|
||||
{
|
||||
public static class NotificationTypes {
|
||||
public const string Connected = "connected";
|
||||
public const string DisConnected = "disconnected";
|
||||
public const string Reconnected = "reconnected";
|
||||
public const string UserPart = "userpart";
|
||||
public const string UserJoin = "userjoin";
|
||||
public const string PrivateMessageDenied = "deniedpv";
|
||||
|
||||
public const string Error = "error";
|
||||
}
|
||||
}
|
||||
33
src/Yavsc.Server/ServerCommands.cs
Normal file
33
src/Yavsc.Server/ServerCommands.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
namespace Yavsc
|
||||
{
|
||||
public static class ServerCommands {
|
||||
|
||||
public const string whois = nameof(whois);
|
||||
public const string whowas = nameof(whowas);
|
||||
|
||||
/// <summary>
|
||||
/// modify a chan or an user
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public const string mode = nameof(mode);
|
||||
|
||||
/// <summary>
|
||||
/// register a channel
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public const string register = nameof(register);
|
||||
|
||||
/// <summary>
|
||||
/// kick some user
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public const string kick = nameof(kick);
|
||||
|
||||
/// <summary>
|
||||
/// ban an user
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public const string ban = nameof(ban);
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue