line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Webqq::Group::Member; |
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
6
|
use Mojo::Webqq::Base 'Mojo::Webqq::Model::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
has [qw( |
5
|
|
|
|
|
|
|
name |
6
|
|
|
|
|
|
|
province |
7
|
|
|
|
|
|
|
sex |
8
|
|
|
|
|
|
|
id |
9
|
|
|
|
|
|
|
country |
10
|
|
|
|
|
|
|
city |
11
|
|
|
|
|
|
|
fullcard |
12
|
|
|
|
|
|
|
state |
13
|
|
|
|
|
|
|
client_type |
14
|
|
|
|
|
|
|
qage |
15
|
|
|
|
|
|
|
join_time |
16
|
|
|
|
|
|
|
last_speak_time |
17
|
|
|
|
|
|
|
level |
18
|
|
|
|
|
|
|
role |
19
|
|
|
|
|
|
|
bad_record |
20
|
|
|
|
|
|
|
_flag |
21
|
|
|
|
|
|
|
_group_id |
22
|
|
|
|
|
|
|
)]; |
23
|
|
|
|
|
|
|
sub card { # from Mojo::Webqq::Base |
24
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
25
|
0
|
0
|
|
|
|
|
if (@_ == 0) { |
26
|
0
|
0
|
|
|
|
|
return defined $self->fullcard ? $self->fullcard : $self->{card}; |
27
|
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
$self->{card} = shift; |
29
|
0
|
|
|
|
|
|
$self; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
has uid => sub{ |
32
|
|
|
|
|
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
return $self->{uid} if defined $self->{uid}; |
34
|
|
|
|
|
|
|
return $self->client->get_qq_from_id($self->id); |
35
|
|
|
|
|
|
|
}; |
36
|
0
|
|
|
0
|
0
|
|
sub qq {$_[0]->uid} |
37
|
|
|
|
|
|
|
sub AUTOLOAD { |
38
|
0
|
|
|
0
|
|
|
my $self = shift; |
39
|
0
|
0
|
|
|
|
|
if($Mojo::Webqq::Group::Member::AUTOLOAD =~ /.*::g(.*)/){ |
40
|
0
|
|
|
|
|
|
my $attr = $1; |
41
|
0
|
|
|
|
|
|
$self->group->$attr(@_); |
42
|
|
|
|
|
|
|
} |
43
|
0
|
|
|
|
|
|
else{die("undefined subroutine $Mojo::Webqq::Group::Member::AUTOLOAD");} |
44
|
|
|
|
|
|
|
} |
45
|
0
|
|
|
0
|
0
|
|
sub nick {$_[0]->name}; |
46
|
|
|
|
|
|
|
sub displayname { |
47
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
48
|
0
|
0
|
|
|
|
|
if($self->client->group_member_use_friend_markname){ |
49
|
0
|
|
|
|
|
|
my $f = $self->client->search_friend(id=>$self->id); |
50
|
0
|
0
|
|
|
|
|
if(defined $f){ |
51
|
0
|
|
0
|
|
|
|
return $f->markname // $self->card // $self->name; |
|
|
|
0
|
|
|
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
else{ |
54
|
0
|
0
|
|
|
|
|
return defined $self->card?$self->card:$self->name; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
else{ |
58
|
0
|
0
|
|
|
|
|
return defined $self->card?$self->card:$self->name; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub update{ |
63
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
64
|
0
|
|
|
|
|
|
my $hash = shift; |
65
|
0
|
|
|
|
|
|
for(grep {substr($_,0,1) ne "_"} keys %$hash){ |
|
0
|
|
|
|
|
|
|
66
|
0
|
0
|
|
|
|
|
if(exists $hash->{$_}){ |
67
|
0
|
0
|
0
|
|
|
|
if(defined $hash->{$_} and defined $self->{$_}){ |
|
|
0
|
0
|
|
|
|
|
68
|
0
|
0
|
|
|
|
|
if($hash->{$_} ne $self->{$_}){ |
69
|
0
|
|
|
|
|
|
my $old_property = $self->{$_}; |
70
|
0
|
|
|
|
|
|
my $new_property = $hash->{$_}; |
71
|
0
|
|
|
|
|
|
$self->{$_} = $hash->{$_}; |
72
|
0
|
|
|
|
|
|
$self->client->emit("group_member_property_change"=>$self,$_,$old_property,$new_property); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
elsif( ! (!defined $hash->{$_} and !defined $self->{$_}) ){ |
76
|
0
|
|
|
|
|
|
my $old_property = $self->{$_}; |
77
|
0
|
|
|
|
|
|
my $new_property = $hash->{$_}; |
78
|
0
|
|
|
|
|
|
$self->{$_} = $hash->{$_}; |
79
|
0
|
|
|
|
|
|
$self->client->emit("group_member_property_change"=>$self,$_,$old_property,$new_property); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
} |
83
|
0
|
|
|
|
|
|
$self; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub send { |
87
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
88
|
0
|
|
|
|
|
|
$self->client->send_sess_message($self,@_); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
sub set_card { |
91
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
92
|
0
|
|
|
|
|
|
my $card = shift; |
93
|
0
|
|
|
|
|
|
$self->group->set_group_member_card($self,$card); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
sub group { |
96
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
97
|
0
|
|
|
|
|
|
return scalar $self->client->search_group(id=>$self->_group_id); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
sub shutup{ |
100
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
101
|
0
|
|
|
|
|
|
my $time = shift; |
102
|
0
|
|
|
|
|
|
$self->group->shutup_group_member($time,$self); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
1; |
105
|
|
|
|
|
|
|
|