Block User

LAST EDIT May 03 2024
Under Development, not available on all shards

Overview

Copied!

The user block feature allows users to control their 1-on-1 interactions within the chat application by blocking other users. When a user is blocked, several changes occur to the blocked user's experience and the blocker’s interactions within the application.

Features

Copied!
  1. Block User: Users can block others in 1-on-1 chats, preventing further direct communication.

  2. Get Blocked Users: Users can view a list of individuals they have blocked.

  3. Unblock User: Users can unblock previously blocked users, allowing direct communication to resume.

How It Works

Copied!
  • When a user blocks another user, direct communication through 1-on-1 channels is terminated. The blocked user will no longer be able to send messages to the blocker.

  • The blocked user cannot add the blocking user to any new or existing channels, whether 1-on-1 or group.

  • Group channels are unaffected by the block, allowing both the blocker and the blocked user to participate in group conversations along with push notifications

  • The blocking user will not receive push notifications from blocked users for the 1-on-1 channels

  • In QueryChannels call, 1:1 channels with blocked users are returned with a blocked:true flag, and messages after the block timestamp won't be included.

  • Blocked users won't appear in the blocking user's list of active chats, and messages from blocked users won't contribute to unread counts.

  • After a user is unblocked, all previous messages in 1-on-1 channels become visible again.

Setup example

Copied!

Any user is allowed to block another user. BlockedUsers are stored at the user level and returned with the rest of the user information when connectUser is called. A user will be blocked until the user is unblocked.

Block User

Copied!

Unblock user

Copied!

Get List of Blocked Users

Copied!