Kernel::System::ChatChannel

NAME

Kernel::System::ChatChannel – chat engine backend

DESCRIPTION

Chat engine backend

PUBLIC INTERFACE

new()

create an object. Do not use it directly, instead use:

    use Kernel::System::ObjectManager;
    local $Kernel::OM = Kernel::System::ObjectManager->new();
    my $ChatChannelObject = $Kernel::OM->Get('Kernel::System::ChatChannel');

ChatChannelAdd()

add a new chat channel

    my $ChatChannelID = $ChatChannelObject->ChatChannelAdd(
        Name              => 'request',        # (required) request or active
        GroupID           => 12,               # (required) GroupID
        UserID            => 1,                # (required) UserID
        ValidID           => 1,                # (optional) ValidID
        Comment           => "Some comment",   # (optional) comment
        NoDefaultCheck    => 1,                # (optional) do not check is name the same like default channel name
        CustomerInterface => 1,                # (optional) is this channel available in the customer interface
        PublicInterface   => 1,                # (optional) is this channel available in the public interface
    );

ChatChannelUpdate()

Update a chat channel.

Returns 1 if update is successful.

    my $Status = $ChatChannelObject->ChatChannelUpdate(
        ChatChannelID     => $ChatChannelID,
        Name              => 'New channel',
        GroupID           => 12,
        ValidID           => 1,
        UserID            => 1,
        CustomerInterface => 1,
        PublicInterface   => 1,
    );

ChatChannelGet()

get a chat channel's data.

    my %ChatChannel = $ChatChannelObject->ChatChannelGet(
        ChatChannelID => $ID,
    );

    my %ChatChannel = $ChatChannelObject->ChatChannelGet(
        ChatChannelName => 'default',
    );

Returns: %ChatChannel = { ChatChannelID => 1, Name => 'Channel name', GroupID => 12, ValidID => 1, CustomerInterface => 1, PublicInterface => 1, CreateTime => '2015-01-01 00:00:00', CreateBy => 1, ChangeTime => '2015-01-01 00:00:00', ChangeBy => 1, Comment => 'Channel comment', };

ChatChannelsGet()

list all chat channels.

    my @AllChatChannels = $ChatChannelObject->ChatChannelsGet(
        Valid             => 1, # (optional)
        IncludeDefault    => 1, # (optional)
        CustomerInterface => 1, # (optional) get channels available for customer interface
        PublicInterface   => 1, # (optional) get channels available for public interface
    );

returns: @AllChatChannels = [ { ChatChannelID => '1', Name => 'Channel name', GroupID => 12, ValidID => 1, CustomerInterface => 1, PublicInterface => 1, CreateTime => 2015-01-01, CreateBy => 1, ChangeTime => 2015-01-01, ChangeBy => 1, Comment => 'Comment', }, … ];

ChatChannelPermissionGet()

Return permission for the particular user and channel. my $Permission = $ChatChannelObject->ChatChannelPermissionGet( UserID => 123, ChatChannelID => 2, ); $Permission = 'Participant';

ChatPermissionChannelGet()

Return all channels where the user has one or more certain permissions.

    my %AvailableChannels = $ChatChannelObject->ChatPermissionChannelGet(
        UserID        => 123,
        Permission    => 'chat_participant',
    );

    my %AvailableChannels = $ChatChannelObject->ChatPermissionChannelGet(
        UserID        => 123,
        Permission    => ['chat_observer', 'chat_participant', 'chat_owner'],
    );

    %AvailableChannels = (
        1 => 'first name',
        2 => 'second name',
    )

ChatChannelDelete()

Delete a chat channel.

Returns 1 if delete is successful.

    my $Response = $ChatChannelObject->ChatChannelDelete(
        ChatChannelID   => $ChatChannelID,
        UserID          => 1,
    );

CustomChatChannelsGet()

Get personal chat channels of given UserID.

    my @CustomChatChannels = $ChatChannelObject->CustomChatChannelsGet(
        Key     => 'ExternalChannels',     # user_preferences key ('ExternalChannels' or 'InternalChannels')
        UserID  => 123,
    );

    @CustomChatChannels = [1,3,5];

CustomChatChannelsSet()

Set personal chat channels of given UserID.

    $ChatChannelObject->CustomChatChannelsSet(
        Key             => 'ExternalChannels',     # user_preferences key ('ExternalChannels' or 'InternalChannels')
        UserChannels    => [ 1, 3, 5 ],            # Array of channel ids
        UserID          => 123,
    );

ChannelLookup()

get id or name for channel

    my $Channel = $ChatChannelObject->ChannelLookup( ChannelID => $ChannelID );

    my $ChannelID = $ChatChannelObject->ChannelLookup( Channel => $Channel );

ChatChannelQueuesGet()

get all chat channel_queue relations.

    my %Relations = $ChatChannelObject->ChatChannelQueuesGet(
        CustomerInterface => 1,     # (optional) Default 0. List only relations for Channels that are allowed in Customer Interface.
    );

DefaultChatChannelGet()

get id of default chat channel. If chat channel does not exist, it will be created

    my $ChannelID = $ChatChannelObject->DefaultChatChannelGet();

DefaultChatChannelSet()

Set the Default Chat Channel.

    $ChatChannelObject->DefaultChatChannelSet( Channel => 'Channels' );
Scroll to Top