AnyEvent-XMPP

 view release on metacpan or  search on metacpan

lib/AnyEvent/XMPP/Error/MUC.pm  view on Meta::CPAN

      } else {
         $self->{type} = 'message_error';
      }

      $self->{message_error} = $error;
   }
}

=item B<type>

This method returns either:

=over 4

=item join_timeout

If the joining of the room took too long.

=item no_config_form

If the room we requested the configuration from didn't provide a
data form.

=item subject_change_forbidden

If changing the subject of a room is not allowed.

=item message_error

If this is an unidentified message error.

=back

If we got a presence error the method C<presence_error> returns a
L<AnyEvent::XMPP::Error::Presence> object with further details. However, this class
tries to provide a mapping for you (the developer) to ease the load of figuring
out which error means what. To make identification of the errors with XEP-0045
more clear I included the error codes and condition names.

Here are the more descriptive types:

=over 4

=item password_required

Entering a room Inform user that a password is required.

(Condition: not-authorized, Code: 401)

=item banned

Entering a room Inform user that he or she is banned from the room

(Condition: forbidden, Code: 403)

=item room_locked

Entering a room Inform user that the room does not exist and someone
is currently creating it.

(Condition: item-not-found, Code: 404)

=item room_not_creatable

Entering a room Inform user that room creation is restricted

(Condition: not-allowed, Code: 405)

=item use_reserved_nick

Entering a room Inform user that the reserved roomnick must be used

(Condition: not-acceptable, Code: 406)

=item not_on_memberlist

Entering a room Inform user that he or she is not on the member list

(Condition: registration-required, Code: 407)

=item nickname_in_use

Entering a room Inform user that his or her desired room nickname is in use or registered by another user

(Condition: conflict, Code: 409)

=item room_full

Entering a room Inform user that the maximum number of users has been reached

(Condition: service-unavailable, Code: 503)

=back

The condition and code are also available through the L<AnyEvent::XMPP::Error::Presence>
object returned by C<presence_error>, see below.

=cut

sub type { $_[0]->{type} }

=item B<text>

This method returns a human readable text
if one is available.

=cut

sub text {
   my ($self) = @_;
   if (my $p = $self->presence_error) {
      return $p->text;
   } elsif (my $m = $self->message_error) {
      return $m->text;
   } else {
      return $self->{text}
   }
}

=item B<presence_error>



( run in 0.421 second using v1.01-cache-2.11-cpan-39bf76dae61 )