Skip to content
Permalink
Browse files

Merge branch 'demoroniser'

  • Loading branch information...
perlDreamer committed Sep 4, 2019
2 parents 5eb106b + 6d8bce0 commit 3ec34e5791464862743ecb11f2ba77858369f872
Showing with 11 additions and 2 deletions.
  1. +3 −0 CHANGES.txt
  2. +2 −1 bin/setup/03_install_perl_modules.sh
  3. +6 −1 lib/Wing/Firebase.pm
@@ -4,6 +4,9 @@ This file tracks the changes to Wing over time. Especially
with respect to new features and compatibility changes.
==========================================================

2019-09-04
* Use Text::Demoroniser to clean messages being sent to Firebase

2019-08-19
* Added wing trends --recalc_one

@@ -74,4 +74,5 @@ URI::Find::Delimited \
Crypt::JWT \
Firebase \
Template::Plugin::JSON::Escape \
Data::Structure::Util
Data::Structure::Util \
Text::Demoroniser
@@ -5,6 +5,7 @@ use Moo;

extends 'Firebase';
use Time::HiRes;
use Text::Demoroniser qw/demoroniser_utf8/;

around BUILDARGS => sub {
my $orig = shift;
@@ -23,7 +24,11 @@ sub object_status {
my $self = shift;
my $object = shift;
my $directory = join '/', $self->directory, $object->id, int(Time::HiRes::time()*1000);
return $self->put($directory, @_);
my $payload = shift;
if (ref($payload) eq 'HASH' && exists $payload->{message}) {
$payload->{message} = demoroniser_utf8($payload->{message});
}
return $self->put($directory, $payload, @_);
}

1;

0 comments on commit 3ec34e5

Please sign in to comment.
You can’t perform that action at this time.