IChatService Interface |
Namespace: CMS.Chat
public interface IChatService
The IChatService type exposes the following members.
Name | Description | |
---|---|---|
AcceptChatRequest |
Accepts initiated chat request.
| |
AcceptInvitation |
Accepts invitation:
- closes specified notification
- inserts user into room (joins)
- sends notification to sender about accepting invite
| |
AddAdmin |
Adds admin to the room. Only admin can do it.
| |
ChangeChatRoom |
Changes existing chat room.
| |
ChangeMyNickname |
Changes nickname of currently logged in user.
| |
CloseAllNotifications |
Closes (markes as read) all notifications which belongs to online users and which were sent until untilWhen.
| |
CloseNotification |
Closes (markes as read) specified notification. This can be used to close generic notifications like InvitationDeclined or InvitationAccepted.
| |
CreateChatRoom |
Creates new chat room.
Current user have to join it manually after creating it.
Code name of this room will be: chatroom_{current_user_id}_{new_guid}
| |
CreateOneToOneChatRoom |
Creates new one-to-one chat room which will be accessible by current user and one more user (invited one).
Display name of new room will be: {nickname_current} - {nickname_invited}
Code name will be: adhoc_{id_lower}-{id_upper} ({id_lower} is the lower id of the two chat users, {id_upper} is the upper one);
A current user have to manually join this room after creating it.
If those two users have chatted before, the previously created room is returned. Code name is used to find previously created chat room.
| |
CreateSupportChatRoom |
Creates new support room. Support room is private room which can be accessed only by creator
and support. When creator writes to this room, support is notified.
| |
CreateSupportChatRoomManual |
Creates new support room. Support room is private room which can be accessed only by creator
and support. When creator writes to this room, support is notified.
This room does not have default greeting message, but messages passed as parameter.
| |
DeclineChatRequest |
Declines initiated chat request.
| |
DeclineInvitation |
Declines invitation:
- closes specified notification
- sends notification to sender about declining invite
| |
DeleteAdmin |
Deletes admin from the room. Only admin can do it.
| |
DeleteChatRoom |
Disables room. User has to be either Global admin, has ManageRooms permission or be creator/admin of this room.
| |
GetChatUserState |
Gets info about currently logged in chat user.
| |
GetPermissions |
Gets permissions of currently logged in user.
| |
GetSupportEngineersOnlineCount |
Gets count of currently logged in support engineers.
| |
InviteToRoom |
Invites user to the chat room. Invitation is inserted into the second user's notifications. Second user can enter the room after accepting the invitation.
Current user has to have admin rights to the room to invite.
| |
JoinRoom |
Joins a room.
Chat user has to be logged in before this operation.
| |
KickUser |
Kicks a chat user from a room. Currently logged user must be an admin to kick another user.
| |
KickUserPermanently |
Kickes user permanently from a private room. If this room is public, it acts as a normal kick.
Kicked user won't be able to enter room again, unless he will be invited one more time.
| |
LeaveRoom |
Leaves chat room.
| |
LeaveRoomPermanently |
Permanently leaves current user from the private chat room (Join/Admin rights are removed from this room).
If room is not private, it acts as normale LeaveRoom().
| |
Logout |
Logouts chat user from chat (not CMSUser).
Leaves all rooms.
If CMSUser is logged in, this operation won't logout the chat user in reality.
| |
Ping |
Keeps user online in global list of chat online users (this method needs to be called periodically).
Checks if there were any changes in:
- rooms (new room added, changed name, etc.) since lastRoomsChange.
- counts of users in rooms since lastUsersInRoomsChange.
- global online users since lastOnlineUsersChange.
- notifications for online user since lastNotificationChange.
If any of this objects has changed, changes are send back to client.
If any of params is null, its objects are not checked. If param is 0, it is the first request and all objects are returned.
| |
PingInitiate |
Checks if there is new initiated chat request pending for this user and returns it. Returns null if there is nothing.
Requests are searched by ContactID and UserID.
| |
PingRoom | Keeping alive user in a room. User has to call this method every few seconds to let server know that he is still online. At the same time a new online users in a room and a new messages in a room are checked. Client sends the last time he made an update of online users (roomUsersLastChange) and messages (roomMessagesLastChange). If something new has happened since that time, the changes are sent back. | |
PostMessage |
Posts a new message to a room.
Chat user has to be logged in and joined this room. Message can not be empty.
| |
PostMessageToUser |
Posts a whisper message to user. This message will be posted to a room, but only sender and receiver of this messages will be able to see it.
| |
Register |
Registers new anonymous chat user. This new user is automatically logged in.
| |
RegisterGuest |
Registers new guest user (user with auto generated nickname).
| |
RejectMessage |
Rejects the message.
Checks for permissions for a specified room (roomID can be get from messageID) and if current chat user has
admin rights, it rejects the message.
| |
SearchOnlineUsers |
Search users who are online globally on a chat (they are performing Ping()) and meet condition (their nickname contains nickname.
|