Channel Handler
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
Called when channel DND level is synced from another device.
Called when channel pinned status is synced from another device.
Called when channel status sync completes.
Called when a channel's translation strategy is synced from another device.
Called when this channel's unread state is synced from another device (for example after the conversation was marked read on another client).
Called when community channel list sync completes.
Called when a community sub-channel is deleted.
Called when a community sub-channel's type changes.
Called when a user is kicked from a community private sub-channel.
Called when remote channels sync completes.
Called when typing status changes in a channel.