… | |
… | |
918 | |
918 | |
919 | =cut |
919 | =cut |
920 | |
920 | |
921 | ############################################################################# |
921 | ############################################################################# |
922 | # object support |
922 | # object support |
|
|
923 | # |
|
|
924 | |
|
|
925 | sub _can_merge { |
|
|
926 | my ($ob1, $ob2) = @_; |
|
|
927 | |
|
|
928 | local $Storable::canonical = 1; |
|
|
929 | my $fob1 = Storable::freeze $ob1; |
|
|
930 | my $fob2 = Storable::freeze $ob2; |
|
|
931 | |
|
|
932 | $fob1 eq $fob2 |
|
|
933 | } |
923 | |
934 | |
924 | sub reattach { |
935 | sub reattach { |
925 | # basically do the same as instantiate, without calling instantiate |
936 | # basically do the same as instantiate, without calling instantiate |
926 | my ($obj) = @_; |
937 | my ($obj) = @_; |
927 | |
938 | |
… | |
… | |
2439 | sub cf::client::send_msg { |
2450 | sub cf::client::send_msg { |
2440 | my ($self, $channel, $msg, $color, @extra) = @_; |
2451 | my ($self, $channel, $msg, $color, @extra) = @_; |
2441 | |
2452 | |
2442 | $msg = $self->pl->expand_cfpod ($msg); |
2453 | $msg = $self->pl->expand_cfpod ($msg); |
2443 | |
2454 | |
2444 | return unless @extra || length $msg; |
|
|
2445 | |
|
|
2446 | $color &= ~cf::NDI_UNIQUE; # just in case... |
2455 | $color &= ~cf::NDI_UNIQUE; # just in case... |
2447 | |
2456 | |
2448 | if (ref $channel) { |
2457 | if (ref $channel) { |
2449 | # send meta info to client, if not yet sent |
2458 | # send meta info to client, if not yet sent |
2450 | unless (exists $self->{channel}{$channel->{id}}) { |
2459 | unless (exists $self->{channel}{$channel->{id}}) { |
… | |
… | |
2452 | $self->ext_event (channel_info => %$channel); |
2461 | $self->ext_event (channel_info => %$channel); |
2453 | } |
2462 | } |
2454 | |
2463 | |
2455 | $channel = $channel->{id}; |
2464 | $channel = $channel->{id}; |
2456 | } |
2465 | } |
|
|
2466 | |
|
|
2467 | return unless @extra || length $msg; |
2457 | |
2468 | |
2458 | if ($self->can_msg) { |
2469 | if ($self->can_msg) { |
2459 | $self->send_packet ("msg " . $self->{json_coder}->encode ([$color, $channel, $msg, @extra])); |
2470 | $self->send_packet ("msg " . $self->{json_coder}->encode ([$color, $channel, $msg, @extra])); |
2460 | } else { |
2471 | } else { |
2461 | # replace some tags by gcfclient-compatible ones |
2472 | # replace some tags by gcfclient-compatible ones |