sysManage#
sysManage#
- sysManage
- .sendRosterMessage(msg) ⇒
number - .sendGroupMessage(msg) ⇒
number - .requireHistoryMessage(uid, sid, amount)
- .sendMentionMessage(params) ⇒
number - .sendInputStatusMessage(uid, status) ⇒
number - .forwardMessage(param) ⇒
number - .getMessageStatus(cid, mid, isGroup) ⇒
string - .asyncFileUpload(param) ⇒
Promise.<FileUploadResult> - .getImage(param) ⇒
string - .deleteConversation(id, other_devices)
- .asyncGetGroupAvatarUploadUrl(params) ⇒
Promise.<FileUpload> - .asyncGetFileUploadChatFileUrl(params) ⇒
Promise.<FileUpload>
sysManage.sendRosterMessage(msg) ⇒ number#
SendSingle chat message
Kind: static method of sysManage
Returns: number - Message ID generated by client
| Param | Type | Description |
|---|---|---|
| msg | object | Message body |
| msg.uid | string | Receiver ID |
| msg.content | string | Message content |
| msg.type | string | Message types: text, image, audio, video, file, location, command, forward |
| msg.ext | string | object | Extension data |
| msg.attachment | string | object | Attachment info |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendRosterMessage" %}{% endlanying_code_snippet %}
sysManage.sendGroupMessage(msg) ⇒ number#
SendGroup chat message
Kind: static method of sysManage
Returns: number - Message ID generated by client
| Param | Type | Description |
|---|---|---|
| msg | object | Send message body |
| msg.gid | string | GroupID |
| msg.content | string | Message content |
| msg.type | string | Message types: text, image, audio, video, file, location, command, forward |
| msg.ext | string | object | Extension data |
| msg.attachment | string | object | Attachment info |
| msg.priority | number | Set message diffusion priority, default 0. 0 means diffusion, and the smaller the number, the more diffused. |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendGroupMessage" %}{% endlanying_code_snippet %}
sysManage.requireHistoryMessage(uid, sid, amount)#
Request history
Kind: static method of sysManage
| Param | Type | Description |
|---|---|---|
| uid | number | SessionID |
| sid | number | Message ID: the message to pull forward from, 0 means pulling from the latest message. |
| amount | number | Number of messages to pull |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="requireHistoryMessage" %}{% endlanying_code_snippet %}
sysManage.sendMentionMessage(params) ⇒ number#
Group-sent @message
Kind: static method of sysManage
Returns: number - Message ID generated by client
| Param | Type | Description |
|---|---|---|
| params | object | |
| params.gid | number | GroupID |
| params.txt | string | Message text content |
| params.mentionAll | boolean | Whether to @ everyone |
| params.mentionList | Array.<number> | List of @member IDs |
| params.mentionedMessage | string | Display content of @messages |
| params.mentionedMessage | string | Push content of @messages |
| params.senderNickname | string | Sender's nickname |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendMentionMessage" %}{% endlanying_code_snippet %}
sysManage.sendInputStatusMessage(uid, status) ⇒ number#
Send type status
Kind: static method of sysManage
Returns: number - Message ID generated by client
| Param | Type | Description |
|---|---|---|
| uid | number | SessionID |
| status | string | Status: nothing - no typing, typing - typing |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendInputStatusMessage" %}{% endlanying_code_snippet %}
sysManage.forwardMessage(param) ⇒ number#
Forward message
Kind: static method of sysManage
Returns: number - Message ID generated by client
| Param | Type | Description |
|---|---|---|
| param | object | Parameter |
| param.uid | number | Receiver's user ID (set only when forwarding a shingle chat) |
| param.gid | number | Receiver's group ID (set only when forwarding a group chat) |
| param.mid | number | Message to forwardID |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="forwardMessage" %}{% endlanying_code_snippet %}
sysManage.getMessageStatus(cid, mid, isGroup) ⇒ string#
Get message status
Kind: static method of sysManage
Returns: string - Message status: unread, delivered, read
| Param | Type | Default | Description |
|---|---|---|---|
| cid | number | SessionID | |
| mid | number | MessageID | |
| isGroup | boolean | false | Whether it is a group chat |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="getMessageStatus" %}{% endlanying_code_snippet %}
sysManage.asyncFileUpload(param) ⇒ Promise.<FileUploadResult>#
Upload file
Kind: static method of sysManage
Returns: Promise.<FileUploadResult> - File uploading result
| Param | Type | Description |
|---|---|---|
| param | object | Parameter |
| param.group_d | number | GroupID |
| param.toType | number | Receiver types: rosterAvatar - user avatar, chat - chat file, groupAvatar - group avatar |
| param.to_id | number | Receiver ID |
| param.file | File | File |
| param.fileType | string | File types: file - general chat file, audio - voice chat file (amr format), image - image chat file, video - video chat file, audio-mp3 - voice chat file (mp3 format), shareFile - general shared file, shareAudio - voice shared file, shareImage - image shared files, shareVideo - video shared files |
| param.chatType | number | Chat types: roster - single chat, group - group chat |
| param.processCallback | fileUploadProgress | Upload progressCallback |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="asyncFileUpload" %}{% endlanying_code_snippet %}
sysManage.getImage(param) ⇒ string#
Assemble image path
Kind: static method of sysManage
Returns: string - ImageAddress
| Param | Type | Description |
|---|---|---|
| param | object | |
| param.avatar | string | FileAddress |
| param.type | string | Types: roster - user, group - group |
| param.thumbnail | boolean | Thumbnail or not: true by default |
| param.sdefault | string | Default image address |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="getImage" %}{% endlanying_code_snippet %}
sysManage.deleteConversation(id, other_devices)#
Delete session
Kind: static method of sysManage
| Param | Type | Default | Description |
|---|---|---|---|
| id | number | SessionID | |
| other_devices | boolean | true | Whether to delete conversations on other devices at the same time |
Example
{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="deleteConversation" %}{% endlanying_code_snippet %}
sysManage.asyncGetGroupAvatarUploadUrl(params) ⇒ Promise.<FileUpload>#
Get the URL of uploading group avatar
Kind: static method of sysManage
Returns: Promise.<FileUpload> - File uploading info
| Param | Type | Description |
|---|---|---|
| params | object | Parameter |
| params.group_id | number | GroupID |
sysManage.asyncGetFileUploadChatFileUrl(params) ⇒ Promise.<FileUpload>#
Get upload address of chat file
Kind: static method of sysManage
Returns: Promise.<FileUpload> - File uploading info
| Param | Type | Description |
|---|---|---|
| params | object | Parameter |
| params.file_type | number | File types: 100 - general chat file, 101 - voice chat file (amr format), 102 - image chat file, 103 - video chat file, 104 - voice chat file (mp3 format) 200 - general shared file, 201 - voice shared file, 202 - image shared file, 203 - video shared file |
| params.to_type | number | Conversation types: 1 - user, 2 - group |
| params.to_id | number | SessionID |