my @text = @_;
my $output = $outputstack[0];
- $text[0] = '%%mxmlrtorrent: %%n' . $text[0];
+ my $format = '%%mxmlrtorrent: %%n' . shift(@text);
+
+ # escape % in parameters from irssi
+ @text = grep { s/%/%%/g } @text;
if (defined($output) and ref($output)) {
- $output->print(sprintf(shift(@text), @text), MSGLEVEL_CLIENTCRAP);
+ $output->print(sprintf($format, @text), MSGLEVEL_CLIENTCRAP);
} else {
- Irssi::print(sprintf(shift(@text), @text));
+ Irssi::print(sprintf($format, @text));
}
}