File Coverage

blib/lib/Protocol/XMPP/Element/Session.pm
Criterion Covered Total %
statement 9 16 56.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 23 56.5


line stmt bran cond sub pod time code
1             package Protocol::XMPP::Element::Session;
2              
3 1     1   268448 use strict;
  1         2  
  1         49  
4 1     1   6 use warnings;
  1         2  
  1         109  
5 1     1   9 use parent qw(Protocol::XMPP::ElementBase);
  1         8  
  1         10  
6              
7             our $VERSION = '0.007'; ## VERSION
8              
9             =head1 NAME
10              
11             Protocol::XMPP::Bind - register ability to deal with a specific feature
12              
13             =head1 SYNOPSIS
14              
15             =head1 DESCRIPTION
16              
17             =head1 METHODS
18              
19             =cut
20              
21             =head2 end_element
22              
23             =cut
24              
25             sub end_element {
26 0     0 1   my $self = shift;
27 0 0         return unless $self->parent->isa('Protocol::XMPP::Element::Features');
28              
29 0           $self->debug("Had session request");
30 0           $self->parent->push_pending(my $f = $self->stream->new_future);
31 0           my $id = $self->next_id;
32 0           $self->stream->pending_iq($id => $f);
33 0           $self->write_xml([
34             'iq',
35             'type' => 'set',
36             id => $id,
37             _content => [[
38             'session',
39             '_ns' => 'xmpp-session'
40             ]]
41             ]);
42             }
43              
44             1;
45              
46             __END__