line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DJabberd::Plugin::PrivateStorage::InMemoryOnly; |
2
|
1
|
|
|
1
|
|
4635
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
3
|
1
|
|
|
1
|
|
5
|
use base 'DJabberd::Plugin::PrivateStorage'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
132
|
|
4
|
|
|
|
|
|
|
use warnings; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head2 load_privatestorage($self, $user, $element) |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Load the element $element for $user from memory. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=cut |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub load_privatestorage { |
14
|
|
|
|
|
|
|
my ($self, $user, $element) = @_; |
15
|
|
|
|
|
|
|
$self->{private_storage} ||= {}; |
16
|
|
|
|
|
|
|
if (exists $self->{private_storage}{$user}) { |
17
|
|
|
|
|
|
|
if (exists $self->{private_storage}{$user}{$element}) |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
return $self->{private_storage}{$user}{$element}->as_xml(); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
return undef; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head2 store_privatestorage($self, $user, $element, $content) |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Store $content for $element and $user in memory. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub store_privatestorage { |
32
|
|
|
|
|
|
|
my ($self, $user, $element, $content) = @_; |
33
|
|
|
|
|
|
|
$self->{private_storage} ||= {}; |
34
|
|
|
|
|
|
|
$self->{private_storage}{$user}{$element} = $content; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |