Skip to main content

Blocklist

After adding a user to the blocklist, you stop receiving direct messages from that user.

  • Blocklist is a one-way operation. If user A blocks user B, B cannot send messages to A (error code 405), but A can still send messages to B.
  • Server API messages are not subject to blocklist restrictions by default. Set verifyBlacklist to 1 to enable.

Add to blocklist

Dart
await NCEngine.user.addToBlocklist(userId, (error) {
if (error == null) print('User blocked');
});

Remove from blocklist

Dart
await NCEngine.user.removeFromBlocklist(userId, (error) {
if (error == null) print('User unblocked');
});

Check blocklist status

Dart
await NCEngine.user.checkBlocked(userId, (isBlocked, error) {
if (error == null) print('Is blocked: $isBlocked');
});

Get blocklist

Dart
await NCEngine.user.getBlocklist((userIds, error) {
if (error == null) print('Blocked users: $userIds');
});