AnyEvent-XMPP
view release on metacpan or search on metacpan
lib/AnyEvent/XMPP/Component.pm view on Meta::CPAN
warn "authenticate called! Please read the documentation of "
."AnyEvent::XMPP::Component why this is an error!"
}
=back
=head1 EVENTS
These additional events can be registered on with C<reg_cb>:
NOTE: The event C<stream_pre_authentication> should _not_ be handled
and just ignored. Don't attach callbacks to it!
=over 4
=item session_ready
This event indicates that the component has connected successfully
and can now be used to transmit stanzas.
=back
lib/AnyEvent/XMPP/Error/MUC.pm view on Meta::CPAN
=cut
sub init {
my ($self) = @_;
if ($self->{presence_error}) {
my %mapping = (
'not-authorized' => 'password_required',
'forbidden' => 'banned',
'item-not-found' => 'room_locked',
'not-allowed' => 'room_not_creatable',
'not-acceptable' => 'use_reserved_nick',
'registration-required' => 'not_on_memberlist',
'conflict' => 'nickname_in_use',
'service-unavailable' => 'room_full',
);
my $cond = $self->{presence_error}->{error_cond};
$self->{type} = $mapping{$cond};
}
if ($self->{message_node}) {
my $error = AnyEvent::XMPP::Error::Message->new (node => $self->{message_node});
if ($self->{message}->any_subject && not defined $self->{message}->any_body) {
lib/AnyEvent/XMPP/Error/MUC.pm view on Meta::CPAN
(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)
t/boilerplate.t view on Meta::CPAN
#!perl -T
use strict;
no warnings;
use Test::More tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open my $fh, "<", $filename
or die "couldn't open $filename for reading: $!";
my %violated;
while (my $line = <$fh>) {
while (my ($desc, $regex) = each %regex) {
if ($line =~ $regex) {
push @{$violated{$desc}||=[]}, $.;
t/boilerplate.t view on Meta::CPAN
}
if (%violated) {
fail("$filename contains boilerplate text");
diag "$_ appears on lines @{$violated{$_}}" for keys %violated;
} else {
pass("$filename contains no boilerplate text");
}
}
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
module_boilerplate_ok('lib/AnyEvent/XMPP.pm');
( run in 0.282 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )