Click or drag to resize
IChatService Methods

The IChatService type exposes the following members.

Methods
  NameDescription
Public methodAcceptChatRequest
Accepts initiated chat request.
Public methodAcceptInvitation
Accepts invitation: - closes specified notification - inserts user into room (joins) - sends notification to sender about accepting invite
Public methodAddAdmin
Adds admin to the room. Only admin can do it.
Public methodCloseAllNotifications
Closes (markes as read) all notifications which belongs to online users and which were sent until untilWhen.
Public methodCloseNotification
Closes (markes as read) specified notification. This can be used to close generic notifications like InvitationDeclined or InvitationAccepted.
Public methodCreateChatRoom
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}
Public methodCreateOneToOneChatRoom
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.
Public methodCreateSupportChatRoom
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.
Public methodCreateSupportChatRoomManual
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.
Public methodDeclineChatRequest
Declines initiated chat request.
Public methodDeclineInvitation
Declines invitation: - closes specified notification - sends notification to sender about declining invite
Public methodDeleteAdmin
Deletes admin from the room. Only admin can do it.
Public methodDeleteChatRoom
Disables room. User has to be either Global admin, has ManageRooms permission or be creator/admin of this room.
Public methodGetChatUserState
Gets info about currently logged in chat user.
Public methodGetPermissions
Gets permissions of currently logged in user.
Public methodGetSupportEngineersOnlineCount
Gets count of currently logged in support engineers.
Public methodChangeChatRoom
Changes existing chat room.
Public methodChangeMyNickname
Changes nickname of currently logged in user.
Public methodInviteToRoom
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.
Public methodJoinRoom
Joins a room. Chat user has to be logged in before this operation.
Public methodKickUser
Kicks a chat user from a room. Currently logged user must be an admin to kick another user.
Public methodKickUserPermanently
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.
Public methodLeaveRoom
Leaves chat room.
Public methodLeaveRoomPermanently
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().
Public methodLogout
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.
Public methodPing
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.
Public methodPingInitiate
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.
Public methodPingRoom

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.

Public methodPostMessage
Posts a new message to a room. Chat user has to be logged in and joined this room. Message can not be empty.
Public methodPostMessageToUser
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.
Public methodRegister
Registers new anonymous chat user. This new user is automatically logged in.
Public methodRegisterGuest
Registers new guest user (user with auto generated nickname).
Public methodRejectMessage
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.
Public methodSearchOnlineUsers
Search users who are online globally on a chat (they are performing Ping()) and meet condition (their nickname contains nickname.
Top
See Also