LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

rosterManage#

rosterManage#

Friend management

rosterManage.asyncGetRosterIdList(force) ⇒ Promise.<Array.<number>>#

Get friend id list

Kind: static method of rosterManage
Returns: Promise.<Array.<number>> - List of user IDs

ParamTypeDescription
forcebooleanWhether to force pull from server: true - pull from server, false - pull from local storage

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncGetRosterIdList" %}{% endlanying_code_snippet %}

rosterManage.asyncGetRosterInfo(roster_id, force) ⇒ Promise.<RosterItem>#

Get friend information

Kind: static method of rosterManage
Returns: Promise.<RosterItem> - Friend info

ParamTypeDescription
roster_idnumberFriend ID
forcebooleanWhether to force pull from server: true - pull from server, false - prefer to pull from local storage

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncGetRosterInfo" %}{% endlanying_code_snippet %}

rosterManage.asyncDeleteRoster(param) ⇒ Promise.<boolean>#

Delete friend

Kind: static method of rosterManage
Returns: Promise.<boolean> - Request results

ParamTypeDescription
paramobjectParameter
param.user_idnumberFriend's user ID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncDeleteRoster" %}{% endlanying_code_snippet %}

rosterManage.asnycGetRosterListDetailByIds(roster_ids) ⇒ Promise.<Array.<module:types~RosterItem>>#

Get user details by id list

Kind: static method of rosterManage
Returns: Promise.<Array.<module:types~RosterItem>> - List of user details

ParamTypeDescription
roster_idsArray.<number>List of user IDs

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asnycGetRosterListDetailByIds" %}{% endlanying_code_snippet %}

rosterManage.getAllRosterDetail() ⇒ Array.<RosterItem>#

Get all cached user details

Kind: static method of rosterManage
Returns: Array.<RosterItem> - List of user details
Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="getAllRosterDetail" %}{% endlanying_code_snippet %}

rosterManage.asyncGetUserProfile(force) ⇒ Promise.<UserProfile>#

Get your own user info

Kind: static method of rosterManage
Returns: Promise.<UserProfile> - User information

ParamTypeDescription
forcebooleanWhether to force pull from server: true - pull from server, false - prefer to pull from local storage

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncGetUserProfile" %}{% endlanying_code_snippet %}

rosterManage.getRosterMessageByRid(uid) ⇒ Array.<Meta>#

Get chat messages based-on session ID

Kind: static method of rosterManage
Returns: Array.<Meta> - List of chat messages

ParamTypeDescription
uidnumberSessionID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="getRosterMessageByRid" %}{% endlanying_code_snippet %}

rosterManage.readRosterMessage(roster_id, mid)#

Modify message status to read

Kind: static method of rosterManage

ParamTypeDescription
roster_idnumberSessionID
midnumberMessageID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="readRosterMessage" %}{% endlanying_code_snippet %}

rosterManage.recallMessage(uid, mid)#

Revoke a message, only valid for last 5 minutes

Kind: static method of rosterManage

ParamTypeDescription
uidnumberSessionID
midnumberMessageID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="recallMessage" %}{% endlanying_code_snippet %}

rosterManage.unreadMessage(uid, mid)#

Set message to unread

Kind: static method of rosterManage

ParamTypeDescription
uidnumberSessionID
midnumberMessageID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="unreadMessage" %}{% endlanying_code_snippet %}

rosterManage.deleteMessage(uid, mid)#

Delete message

Kind: static method of rosterManage

ParamTypeDescription
uidnumberSessionID
midnumberMessageID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="deleteMessage" %}{% endlanying_code_snippet %}

rosterManage.appendMessageContent(uid, mid, content)#

Append message content

Kind: static method of rosterManage

ParamTypeDescription
uidnumberSessionID
midnumberMessageID
contentstringAppended message content

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="appendMessageContent" %}{% endlanying_code_snippet %}

rosterManage.replaceMessage(uid, mid, content, config, ext)#

Update message content

Kind: static method of rosterManage

ParamTypeDefaultDescription
uidnumberSessionID
midnumberMessageID
contentstringUpdated message content
configstring | objectnullUpdated message configuration
extstring | objectnullUpdated message extension data

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="replaceMessage" %}{% endlanying_code_snippet %}

rosterManage.getRosterInfo(rid) ⇒ RosterItem#

Get friend information

Kind: static method of rosterManage
Returns: RosterItem - Friend info

ParamTypeDescription
ridnumberFriend ID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="getRosterInfo" %}{% endlanying_code_snippet %}

rosterManage.getUnreadCount(uid) ⇒ number#

Get the number of unread messages for a given conversation

Kind: static method of rosterManage
Returns: number - Number of unreads

ParamTypeDescription
uidnumberSessionID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="getUnreadCount" %}{% endlanying_code_snippet %}

rosterManage.asyncGetApplyList(params) ⇒ Promise.<Array.<module:types~RosterApplication>>#

Get friend request list

Kind: static method of rosterManage
Returns: Promise.<Array.<module:types~RosterApplication>> - List of friend requests

ParamTypeDescription
paramsobjectParameter
params.cursornumberGet from where: you can pass an empty string to get from the beginning

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncGetApplyList" %}{% endlanying_code_snippet %}

rosterManage.asyncGetBlockedlist(params) ⇒ Promise.<Array.<number>>#

Get blacklist

Kind: static method of rosterManage
Returns: Promise.<Array.<number>> - List of user IDs

ParamTypeDescription
paramsobjectParameter:Empty object

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncGetBlockedlist" %}{% endlanying_code_snippet %}

rosterManage.asyncBlockeAdd(params) ⇒ Promise.<boolean>#

Add to blacklist

Kind: static method of rosterManage
Returns: Promise.<boolean> - Success or not

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncBlockeAdd" %}{% endlanying_code_snippet %}

rosterManage.asyncBlockeRemove(params) ⇒ Promise.<boolean>#

Remove blacklist

Kind: static method of rosterManage
Returns: Promise.<boolean> - Success or not

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncBlockeRemove" %}{% endlanying_code_snippet %}

rosterManage.asyncApply(params) ⇒ Promise.<boolean>#

Request to add friend

Kind: static method of rosterManage
Returns: Promise.<boolean> - Success or not

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID
params.aliasstringComment

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncApply" %}{% endlanying_code_snippet %}

rosterManage.asyncAccept(params) ⇒ Promise.<boolean>#

Approve add-friend request

Kind: static method of rosterManage
Returns: Promise.<boolean> - Success or not

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncAccept" %}{% endlanying_code_snippet %}

rosterManage.asyncDecline(params) ⇒ Promise.<boolean>#

Reject friend request

Kind: static method of rosterManage
Returns: Promise.<boolean> - Success or not

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncDecline" %}{% endlanying_code_snippet %}

rosterManage.asyncUpdateRosterExt(params) ⇒ Promise.<boolean>#

Modify the Friend extension field

Kind: static method of rosterManage
Returns: Promise.<boolean> - Success or not

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID
params.extstringExtension data
params.mute_notificationbooleanWhether to receive message notifications

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncUpdateRosterExt" %}{% endlanying_code_snippet %}

rosterManage.asyncUpdateRosterAlias(params) ⇒ Promise.<boolean>#

Updates the contact alias in extension data

Kind: static method of rosterManage
Returns: Promise.<boolean> - Success or not

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID
params.aliasstringName in comment
params.mute_notificationbooleanWhether to receive message notifications

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncUpdateRosterAlias" %}{% endlanying_code_snippet %}

rosterManage.asyncSearchRosterByName(params) ⇒ Promise.<RosterItem>#

Search for user by name

Kind: static method of rosterManage
Returns: Promise.<RosterItem> - User information

ParamTypeDescription
paramsobjectParameter
params.usernamestringUsername

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncSearchRosterByName" %}{% endlanying_code_snippet %}

rosterManage.asyncSearchRosterById(params) ⇒ Promise.<RosterItem>#

Search for user by ID

Kind: static method of rosterManage
Returns: Promise.<RosterItem> - User information

ParamTypeDescription
paramsobjectParameter
params.user_idnumberUser ID

Example

{% lanying_code_snippet repo="lanying-im-web",class="rosterManage",function="asyncSearchRosterById" %}{% endlanying_code_snippet %}
Generated API content with concise AI notes where context helps.