… | |
… | |
27 | |
27 | |
28 | Scalar::Util::weaken ($::self = $self); # singleton... |
28 | Scalar::Util::weaken ($::self = $self); # singleton... |
29 | |
29 | |
30 | $self->{conn} = new KGS::Protocol::Client; |
30 | $self->{conn} = new KGS::Protocol::Client; |
31 | |
31 | |
32 | $self->listen ($self->{conn}, qw(login userpic idle_warn msg_chat)); |
32 | $self->listen ($self->{conn}, qw(login userpic idle_warn msg_chat chal_defaults)); |
33 | |
33 | |
34 | $self->{roomlist} = new roomlist conn => $self->{conn}, app => $self; |
34 | $self->{roomlist} = new roomlist conn => $self->{conn}, app => $self; |
35 | |
35 | |
36 | $self->set_title ('kgsueme'); |
36 | $self->set_title ('kgsueme'); |
37 | gtk::state $self, "main::window", undef, window_size => [400, 500]; |
37 | gtk::state $self, "main::window", undef, window_size => [400, 500]; |
… | |
… | |
151 | $self->open_user (name => $msg->{name})->inject ($msg); |
151 | $self->open_user (name => $msg->{name})->inject ($msg); |
152 | } |
152 | } |
153 | } |
153 | } |
154 | } |
154 | } |
155 | |
155 | |
|
|
156 | sub inject_chal_defaults { |
|
|
157 | my ($self, $msg) = @_; |
|
|
158 | |
|
|
159 | $self->{defaults} = $msg->{defaults}; |
|
|
160 | } |
|
|
161 | |
156 | my %userpic; |
162 | my %userpic; |
157 | my %userpic_cb; |
163 | my %userpic_cb; |
158 | |
164 | |
159 | # static method to request the userimage and call the cb when it's available. |
165 | # static method to request the userimage and call the cb when it's available. |
160 | sub userpic { |
166 | sub userpic { |