- if ($clones > 0) {
- my $oldctxt = get_context;
- if (set_context $chan, $serv) {
- print $ph clone_enter_str $userhost, $nick, $clones;
- set_context $oldctxt;
- } else {
- delay JOIN_DELAY, sub {
- my $oldctxt = get_context;
- return unless set_context $chan, $serv;
+ return EAT_NONE unless $clones > 0;
+
+ local_context $chan, $serv => sub {
+ print $ph clone_enter_str $userhost, $nick, $clones;
+ 1
+ } or do {
+ delay JOIN_DELAY, sub {
+ local_context $chan, $serv => sub {