Ah, I should have searched but I just assumed it was a bug. I had no
idea meteor aimed to be client agnostic. I assumed JS + Flash would be
about it.
I don't know if I like the idea of plugin's though, they introduce
overhead in the form of plugin management and the only one I can think
of is escaping.
The server documentation states this:
Message template, content to send for each event: ~text~, ~id~,
~channel~ and ~timestamp~ will be replaced by the appropriate values.
Format: String, Default: <script>p(~id~,"~channel~","~text~");</script>
\r\n
What about just adding an ~escapedtext~ as a possible argument? All
format agnostic behaviour will continue to function as is and the only
thing that needs to change is the MessageTemplate for the javascript
case.
Patch below if someone likes this idea enough to push it into the main
repo.
Aaron
-----------------
diff --git a/meteor_daemon/Meteor/Config.pm b/meteor_daemon/Meteor/
Config.pm
index 6309b1d..3f2849e 100644
--- a/meteor_daemon/Meteor/Config.pm
+++ b/meteor_daemon/Meteor/Config.pm
@@ -85,7 +85,7 @@ package Meteor::Config;
MaxTime => 0,
'Message template, ~text~, ~id~, ~channel~ and ~timestamp~ will be
replaced by the appropriate values',
- MessageTemplate => '<script>p
(~id~,"~channel~","~text~");</script>\r\n',
+ MessageTemplate => '<script>p
(~id~,"~channel~","~escapedtext~");</script>\r\n',
'Interval at which PingMessage is sent to all persistent subscriber
connections. Must be at least 3 if set higher than zero. Set to zero
to disable.',
PingInterval => 5,
@@ -395,4 +395,4 @@ EOT
}
diff --git a/meteor_daemon/Meteor/Message.pm b/meteor_daemon/Meteor/
Message.pm
index eb9ac03..dee2c81 100644
--- a/meteor_daemon/Meteor/Message.pm
+++ b/meteor_daemon/Meteor/Message.pm
@@ -61,6 +61,8 @@ sub newWithID {
$self->{'timestamp'}=time;
$self->{'id'}=$id;
$self->{'text'}=$text;
+ $self->{'escapedtext'} = $text;
+ $self->{'escapedtext'} =~ s/\\/\\\\/g;
$::Statistics->{'unique_messages'}++;
@@ -75,6 +77,8 @@ sub setText {
my $text=shift || '';
$self->{'text'}=$text;
+ $self->{'escapedtext'} = $text;
+ $self->{'escapedtext'} =~ s/\\/\\\\/g;
}
sub channelName {
@@ -128,4 +132,4 @@ sub messageWithTemplate {
}
On Oct 19, 2:10 am, Kevin Peno <
kevinp...@gmail.com> wrote:
> This has been brought up before. The reasoning behind the lack of escaping
> is that meteor is designed to be client agnostic (which most people seem to
> agree on). So, because of this, you will need to escapse said strings
> yourself.
>
> For more on the debate and the ultimate decision, please see this thread:
>
>
http://groups.google.com/group/meteorserver/browse_thread/thread/d984...