line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Webqq::Friend; |
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
5
|
use Mojo::Webqq::Base 'Mojo::Webqq::Model::Base'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
has [qw( |
5
|
|
|
|
|
|
|
flag |
6
|
|
|
|
|
|
|
id |
7
|
|
|
|
|
|
|
category |
8
|
|
|
|
|
|
|
name |
9
|
|
|
|
|
|
|
face |
10
|
|
|
|
|
|
|
markname |
11
|
|
|
|
|
|
|
is_vip |
12
|
|
|
|
|
|
|
vip_level |
13
|
|
|
|
|
|
|
state |
14
|
|
|
|
|
|
|
client_type |
15
|
|
|
|
|
|
|
_flag |
16
|
|
|
|
|
|
|
)]; |
17
|
|
|
|
|
|
|
has uid => sub{ |
18
|
|
|
|
|
|
|
my $self = shift; |
19
|
|
|
|
|
|
|
return $self->{uid} if defined $self->{uid}; |
20
|
|
|
|
|
|
|
return $self->client->get_qq_from_id($self->id); |
21
|
|
|
|
|
|
|
}; |
22
|
0
|
|
|
0
|
0
|
|
sub qq {$_[0]->uid} |
23
|
0
|
|
|
0
|
0
|
|
sub nick {$_[0]->name} |
24
|
|
|
|
|
|
|
sub displayname { |
25
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
26
|
0
|
0
|
|
|
|
|
return defined $self->markname?$self->markname:$self->name; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
sub update{ |
29
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
my $hash = shift; |
31
|
0
|
|
|
|
|
|
for(grep {substr($_,0,1) ne "_"} keys %$hash){ |
|
0
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
|
if(exists $hash->{$_}){ |
33
|
0
|
0
|
0
|
|
|
|
if(defined $hash->{$_} and defined $self->{$_}){ |
|
|
0
|
0
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
if($hash->{$_} ne $self->{$_}){ |
35
|
0
|
|
|
|
|
|
my $old_property = $self->{$_}; |
36
|
0
|
|
|
|
|
|
my $new_property = $hash->{$_}; |
37
|
0
|
|
|
|
|
|
$self->{$_} = $hash->{$_}; |
38
|
0
|
|
|
|
|
|
$self->client->emit("friend_property_change"=>$self,$_,$old_property,$new_property); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
elsif( ! (!defined $hash->{$_} and !defined $self->{$_}) ){ |
42
|
0
|
|
|
|
|
|
my $old_property = $self->{$_}; |
43
|
0
|
|
|
|
|
|
my $new_property = $hash->{$_}; |
44
|
0
|
|
|
|
|
|
$self->{$_} = $hash->{$_}; |
45
|
0
|
|
|
|
|
|
$self->client->emit("friend_property_change"=>$self,$_,$old_property,$new_property); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
0
|
|
|
|
|
|
$self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub send { |
53
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
54
|
0
|
|
|
|
|
|
$self->client->send_friend_message($self,@_); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |