… | |
… | |
165 | |
165 | |
166 | return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $target, $msg); |
166 | return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $target, $msg); |
167 | |
167 | |
168 | my $name = $who->name; |
168 | my $name = $who->name; |
169 | |
169 | |
|
|
170 | if ($target =~ /irc\//) { |
|
|
171 | my (undef, $nick) = split /\//, $target, 2; |
|
|
172 | $who->message ("You tell $target: $args"); |
|
|
173 | ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $msg); |
170 | if (my $other = cf::player::find $target) { |
174 | } elsif (my $other = cf::player::find $target) { |
171 | |
175 | |
172 | if ($msg) { |
176 | if ($msg) { |
173 | if ($target eq $name) { |
177 | if ($target eq $name) { |
174 | $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); |
178 | $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); |
175 | } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { |
179 | } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { |
… | |
… | |
197 | |
201 | |
198 | utf8::decode $args; |
202 | utf8::decode $args; |
199 | |
203 | |
200 | return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args); |
204 | return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args); |
201 | |
205 | |
|
|
206 | if ($who->{ext_last_tell} =~ /irc\//) { |
|
|
207 | my (undef, $nick) = split /\//, $who->{ext_last_tell}, 2; |
|
|
208 | $who->message ("You tell " . $who->{ext_last_tell} . ": $args"); |
|
|
209 | ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $args); |
202 | if (my $other = cf::player::find $who->{ext_last_tell}) { |
210 | } elsif (my $other = cf::player::find $who->{ext_last_tell}) { |
203 | |
211 | |
204 | if ($args) { |
212 | if ($args) { |
205 | $other->ob->{ext_ignore_tell}{$name} >= time |
213 | $other->ob->{ext_ignore_tell}{$name} >= time |
206 | or delete $other->ob->{ext_ignore_tell}{$name}; |
214 | or delete $other->ob->{ext_ignore_tell}{$name}; |
207 | |
215 | |
… | |
… | |
218 | } else { |
226 | } else { |
219 | $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); |
227 | $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); |
220 | } |
228 | } |
221 | |
229 | |
222 | } else { |
230 | } else { |
223 | $who->message ("Can't reply, player left. Your message: $args", cf::NDI_UNIQUE); |
231 | $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE); |
224 | } |
232 | } |
225 | }; |
233 | }; |
226 | |
234 | |
227 | cf::register_command ignore => 0, sub { |
235 | cf::register_command ignore => 0, sub { |
228 | my ($who, $args) = @_; |
236 | my ($who, $args) = @_; |