C# Class JabbR.Services.ChatService

Inheritance: IChatService
Datei anzeigen Open project: ucdavis/JabbR Class Usage Examples

Public Methods

Method Description
AddAdmin ( JabbR.Models.ChatUser admin, JabbR.Models.ChatUser targetUser ) : void
AddClient ( JabbR.Models.ChatUser user, string clientId, string userAgent ) : JabbR.Models.ChatClient
AddMessage ( JabbR.Models.ChatUser user, JabbR.Models.ChatRoom room, string id, string content ) : ChatMessage
AddOwner ( JabbR.Models.ChatUser ownerOrCreator, JabbR.Models.ChatUser targetUser, JabbR.Models.ChatRoom targetRoom ) : void
AddRoom ( JabbR.Models.ChatUser user, string name ) : JabbR.Models.ChatRoom
AllowUser ( JabbR.Models.ChatUser user, JabbR.Models.ChatUser targetUser, JabbR.Models.ChatRoom targetRoom ) : void
AppendMessage ( string id, string content ) : void
BanUser ( JabbR.Models.ChatUser admin, JabbR.Models.ChatUser targetUser ) : void
ChangeTopic ( JabbR.Models.ChatUser user, JabbR.Models.ChatRoom room, string newTopic ) : void
ChangeWelcome ( JabbR.Models.ChatUser user, JabbR.Models.ChatRoom room, string newWelcome ) : void
ChatService ( ICache cache, IJabbrRepository repository ) : System
CloseRoom ( ChatUser user, ChatRoom targetRoom ) : void
DisconnectClient ( string clientId ) : string
JoinRoom ( ChatUser user, ChatRoom room, string inviteCode ) : void
KickUser ( ChatUser user, ChatUser targetUser, ChatRoom targetRoom ) : void
LeaveRoom ( ChatUser user, ChatRoom room ) : void
LockRoom ( ChatUser user, ChatRoom targetRoom ) : void
OpenRoom ( ChatUser user, ChatRoom targetRoom ) : void
RemoveAdmin ( ChatUser admin, ChatUser targetUser ) : void
RemoveOwner ( ChatUser creator, ChatUser targetUser, ChatRoom targetRoom ) : void
SetInviteCode ( ChatUser user, ChatRoom room, string inviteCode ) : void
UnallowUser ( ChatUser user, ChatUser targetUser, ChatRoom targetRoom ) : void
UpdateActivity ( ChatUser user, string clientId, string userAgent ) : void

Private Methods

Method Description
EnsureAdmin ( ChatUser user ) : void
EnsureCreator ( ChatUser user, ChatRoom room ) : void
EnsureCreatorOrAdmin ( ChatUser user, ChatRoom room ) : void
EnsureOwner ( ChatUser user, ChatRoom room ) : void
EnsureOwnerOrAdmin ( ChatUser user, ChatRoom room ) : void
GetCountry ( string isoCode ) : string
IsUserAllowed ( ChatRoom room, ChatUser user ) : bool
IsValidRoomName ( string name ) : bool
NormalizeRoomName ( string roomName ) : string
ValidateIsoCode ( string isoCode ) : void
ValidateNote ( string note, string noteTypeName = "note", int maxLength = null ) : void
ValidateTopic ( string topic ) : void
ValidateWelcome ( string message ) : void

Method Details

AddAdmin() public method

public AddAdmin ( JabbR.Models.ChatUser admin, JabbR.Models.ChatUser targetUser ) : void
admin JabbR.Models.ChatUser
targetUser JabbR.Models.ChatUser
return void

AddClient() public method

public AddClient ( JabbR.Models.ChatUser user, string clientId, string userAgent ) : JabbR.Models.ChatClient
user JabbR.Models.ChatUser
clientId string
userAgent string
return JabbR.Models.ChatClient

AddMessage() public method

public AddMessage ( JabbR.Models.ChatUser user, JabbR.Models.ChatRoom room, string id, string content ) : ChatMessage
user JabbR.Models.ChatUser
room JabbR.Models.ChatRoom
id string
content string
return JabbR.Models.ChatMessage

AddOwner() public method

public AddOwner ( JabbR.Models.ChatUser ownerOrCreator, JabbR.Models.ChatUser targetUser, JabbR.Models.ChatRoom targetRoom ) : void
ownerOrCreator JabbR.Models.ChatUser
targetUser JabbR.Models.ChatUser
targetRoom JabbR.Models.ChatRoom
return void

AddRoom() public method

public AddRoom ( JabbR.Models.ChatUser user, string name ) : JabbR.Models.ChatRoom
user JabbR.Models.ChatUser
name string
return JabbR.Models.ChatRoom

AllowUser() public method

public AllowUser ( JabbR.Models.ChatUser user, JabbR.Models.ChatUser targetUser, JabbR.Models.ChatRoom targetRoom ) : void
user JabbR.Models.ChatUser
targetUser JabbR.Models.ChatUser
targetRoom JabbR.Models.ChatRoom
return void

AppendMessage() public method

public AppendMessage ( string id, string content ) : void
id string
content string
return void

BanUser() public method

public BanUser ( JabbR.Models.ChatUser admin, JabbR.Models.ChatUser targetUser ) : void
admin JabbR.Models.ChatUser
targetUser JabbR.Models.ChatUser
return void

ChangeTopic() public method

public ChangeTopic ( JabbR.Models.ChatUser user, JabbR.Models.ChatRoom room, string newTopic ) : void
user JabbR.Models.ChatUser
room JabbR.Models.ChatRoom
newTopic string
return void

ChangeWelcome() public method

public ChangeWelcome ( JabbR.Models.ChatUser user, JabbR.Models.ChatRoom room, string newWelcome ) : void
user JabbR.Models.ChatUser
room JabbR.Models.ChatRoom
newWelcome string
return void

ChatService() public method

public ChatService ( ICache cache, IJabbrRepository repository ) : System
cache ICache
repository IJabbrRepository
return System

CloseRoom() public method

public CloseRoom ( ChatUser user, ChatRoom targetRoom ) : void
user ChatUser
targetRoom ChatRoom
return void

DisconnectClient() public method

public DisconnectClient ( string clientId ) : string
clientId string
return string

JoinRoom() public method

public JoinRoom ( ChatUser user, ChatRoom room, string inviteCode ) : void
user ChatUser
room ChatRoom
inviteCode string
return void

KickUser() public method

public KickUser ( ChatUser user, ChatUser targetUser, ChatRoom targetRoom ) : void
user ChatUser
targetUser ChatUser
targetRoom ChatRoom
return void

LeaveRoom() public method

public LeaveRoom ( ChatUser user, ChatRoom room ) : void
user ChatUser
room ChatRoom
return void

LockRoom() public method

public LockRoom ( ChatUser user, ChatRoom targetRoom ) : void
user ChatUser
targetRoom ChatRoom
return void

OpenRoom() public method

public OpenRoom ( ChatUser user, ChatRoom targetRoom ) : void
user ChatUser
targetRoom ChatRoom
return void

RemoveAdmin() public method

public RemoveAdmin ( ChatUser admin, ChatUser targetUser ) : void
admin ChatUser
targetUser ChatUser
return void

RemoveOwner() public method

public RemoveOwner ( ChatUser creator, ChatUser targetUser, ChatRoom targetRoom ) : void
creator ChatUser
targetUser ChatUser
targetRoom ChatRoom
return void

SetInviteCode() public method

public SetInviteCode ( ChatUser user, ChatRoom room, string inviteCode ) : void
user ChatUser
room ChatRoom
inviteCode string
return void

UnallowUser() public method

public UnallowUser ( ChatUser user, ChatUser targetUser, ChatRoom targetRoom ) : void
user ChatUser
targetUser ChatUser
targetRoom ChatRoom
return void

UpdateActivity() public method

public UpdateActivity ( ChatUser user, string clientId, string userAgent ) : void
user ChatUser
clientId string
userAgent string
return void