SDKsWASMEnterprise
Set friend request permissions
Choose how requests to add the current account as a friend are handled.
addFriendPermission controls whether the current user must approve requests from other users. This account-level policy is an Enterprise capability and should not be saved together with ordinary profile fields such as nickname and avatar.
import { AddFriendPermission } from '@openim/wasm-client-sdk';
await openimsdk.setSelfInfo({
addFriendPermission: AddFriendPermission.AddFriendAllowed,
});| Enum value | Numeric value | Meaning |
|---|---|---|
AddFriendPermission.AddFriendAllowed | 0 | Allow requests, but require the current user to approve them. |
AddFriendPermission.AddFriendAllowedNoReview | 1 | Allow the relationship to be created without approval from the current user. |
AddFriendPermission.AddFriendDenied | 2 | Do not allow other users to add the current account. |
This setting affects only subsequent attempts to add the account. It does not remove existing friendships or automatically process pending applications.
A successful Promise means that the update request has completed, not that OnSelfInfoUpdated has arrived. See Update your profile to learn how to receive the event or query the latest profile again.
Was this page helpful?