… | |
… | |
3235 | =cut |
3235 | =cut |
3236 | |
3236 | |
3237 | sub cf::client::ext_msg($$@) { |
3237 | sub cf::client::ext_msg($$@) { |
3238 | my ($self, $type, @msg) = @_; |
3238 | my ($self, $type, @msg) = @_; |
3239 | |
3239 | |
3240 | if ($self->extcmd == 2) { |
|
|
3241 | $self->send_big_packet ("ext " . $self->{json_coder}->encode ([$type, @msg])); |
3240 | $self->send_big_packet ("ext " . $self->{json_coder}->encode ([$type, @msg])); |
3242 | } elsif ($self->extcmd == 1) { # TODO: remove |
|
|
3243 | push @msg, msgtype => "event_$type"; |
|
|
3244 | $self->send_big_packet ("ext " . $self->{json_coder}->encode ({@msg})); |
|
|
3245 | } |
|
|
3246 | } |
3241 | } |
3247 | |
3242 | |
3248 | =item $client->ext_reply ($msgid, @msg) |
3243 | =item $client->ext_reply ($msgid, @msg) |
3249 | |
3244 | |
3250 | Sends an ext reply to the client. |
3245 | Sends an ext reply to the client. |
3251 | |
3246 | |
3252 | =cut |
3247 | =cut |
3253 | |
3248 | |
3254 | sub cf::client::ext_reply($$@) { |
3249 | sub cf::client::ext_reply($$@) { |
3255 | my ($self, $id, @msg) = @_; |
3250 | my ($self, $id, @msg) = @_; |
3256 | |
|
|
3257 | return unless $self->extcmd == 2; |
|
|
3258 | |
3251 | |
3259 | $self->send_big_packet ("ext " . $self->{json_coder}->encode (["reply-$id", @msg])); |
3252 | $self->send_big_packet ("ext " . $self->{json_coder}->encode (["reply-$id", @msg])); |
3260 | } |
3253 | } |
3261 | |
3254 | |
3262 | =item $success = $client->query ($flags, "text", \&cb) |
3255 | =item $success = $client->query ($flags, "text", \&cb) |