File Coverage

blib/lib/Protocol/XMPP/Element/Success.pm
Criterion Covered Total %
statement 9 15 60.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 20 65.0


line stmt bran cond sub pod time code
1             package Protocol::XMPP::Element::Success;
2              
3 1     1   277362 use strict;
  1         2  
  1         45  
4 1     1   6 use warnings;
  1         3  
  1         83  
5 1     1   11 use parent qw(Protocol::XMPP::ElementBase);
  1         3  
  1         9  
6              
7             our $VERSION = '0.007'; ## VERSION
8              
9             =head1 NAME
10              
11             Protocol::XMPP::Success - indicate success for an operation
12              
13             =head1 SYNOPSIS
14              
15             =head1 DESCRIPTION
16              
17             =head1 METHODS
18              
19             =cut
20              
21             sub end_element {
22 0     0 1   my $self = shift;
23 0           $self->debug("Successful response");
24             # On successful authorisation, we need to start a new stream (without closing
25             # the original one) so that we can go through stream header negotiation again:
26             # authorisation may have enabled additional features that were not advertised
27             # previously.
28 0           $self->stream->reset;
29 0           $self->write_text(@{$self->stream->preamble});
  0            
30 0           $self->is_authorised(1);
31             }
32              
33             1;
34              
35             __END__