ChannelHandler

public interface ChannelHandler

Channel status event handler.

Listens for channel-level status changes and sync events, including:

  • Multi-device sync: pinned state, do-not-disturb level, and translation strategy changes made on other devices are synced to the current device

  • Remote sync: server-side channel list pull completion

  • Typing status: real-time typing indicators from other users

  • Community events: sub-channel type changes, deletions, and user kicks

Register via NCEngine.addChannelHandler. All callback methods have default empty implementations; override only the callbacks you need.

NCEngine.addChannelHandler("CHANNEL_HANDLER_ID", object : ChannelHandler {
override fun onChannelPinnedSync(event: ChannelPinnedSyncEvent) {
println("Channel ${event.channelIdentifier.channelId} pinned: ${event.isPinned}")
}

override fun onChannelNoDisturbLevelSync(event: ChannelNoDisturbLevelSyncEvent) {
println("Channel ${event.channelIdentifier.channelId} DND level: ${event.level}")
}

override fun onChannelStatusSyncCompleted(event: ChannelStatusSyncCompletedEvent) {
if (event.error == null) {
println("Channel status sync completed")
}
}

override fun onChannelTranslateStrategySync(event: ChannelTranslateStrategySyncEvent) {
println("Channel ${event.channelIdentifier.channelId} translate strategy: ${event.strategy}")
}

override fun onRemoteChannelsSyncCompleted(event: RemoteChannelsSyncCompletedEvent) {
if (event.error == null) {
println("Remote channels sync completed")
}
}
})

Functions

Link copied to clipboard

Called when channel DND level is synced from another device.

Link copied to clipboard

Called when channel pinned status is synced from another device.

Link copied to clipboard

Called when channel status sync completes.

Link copied to clipboard

Called when a channel's translation strategy is synced from another device.

Link copied to clipboard

Called when community channel list sync completes.

Link copied to clipboard

Called when a community sub-channel is deleted.

Link copied to clipboard

Called when a community sub-channel's type changes.

Link copied to clipboard

Called when a user is kicked from a community private sub-channel.

Link copied to clipboard

Called when remote channels sync completes.

Link copied to clipboard

Called when typing status changes in a channel.