The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Convos::Core::Dialog - A convos dialog base class

DESCRIPTION

Convos::Core::Dialog represents a dialog (conversation) with one or more participants.

ATTRIBUTES

connection

Holds a Convos::Core::Connection object.

frozen

  $str = $self->frozen;

Will be set to a description if the dialog is "frozen", which means you are no longer part of it.

id

  $str = $self->id;
  $str = $class->id(\%attr);

Returns a unique identifier for a dialog.

is_private

  $bool = $self->is_private;

Returns true if you are only talking to a single user and no other participants can join the dialog.

name

  $str = $self->name;

The name of this dialog.

last_active

  $datetime = $self->last_active;
  $self = $self->last_active($datetime);

Holds an datetime timestring of last time this dialog received a message.

last_read

  $datetime = $self->last_read;
  $self = $self->last_read($datetime);

Holds an datetime timestring of last time this dialog was active in frontend.

password

  $str = $self->password;

The password used to join this dialog.

topic

  $str = $self->topic;

The topic (subject) of the dialog.

METHODS

messages

  $self = $self->messages(\%query, sub { my ($self, $err, $messages) = @_; });

Will fetch messages from persistent backend.

See also "messages" in Convos::Core::Backend.

calculate_unread

  $self = $self->calculate_unread(sub { my ($self, $err) = @_; });

Used to find the number of unread messages after "last_read".

This method is EXPERIMENTAL.

stash

  $hash = $self->stash;
  $self->stash->{"plugin.foo"} = 42;

The stash can be used by plugins to store extra information on a dialog object.

This method is EXPERIMENTAL.

AUTHOR

Jan Henning Thorsen - jhthorsen@cpan.org