File tree 2 files changed +24
-2
lines changed
frontend/public/javascripts
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -678,6 +678,9 @@ class Pusher extends PusherPopper {
678
678
if ( ! note ) {
679
679
continue ;
680
680
}
681
+ for ( let k in ( this . variables || { } ) ) {
682
+ note . pr [ k ] = this . variables [ k ] ;
683
+ }
681
684
682
685
let p = pf [ 0 ] ,
683
686
d = note . _id . getTimestamp ( ) . getTime ( ) ,
Original file line number Diff line number Diff line change 816
816
return ;
817
817
}
818
818
Object . keys ( userPropertiesDto ) . forEach ( function ( key ) {
819
- userPropertiesDto [ key ] . l = countlyPushNotification . helper . findUserPropertyLabelByValue ( userPropertiesDto [ key ] . k , userProperties ) ;
819
+ if ( userPropertiesDto [ key ] . t === UserPropertyTypeEnum . API ) {
820
+ userPropertiesDto [ key ] . l = userPropertiesDto [ key ] . k ;
821
+ }
822
+ else {
823
+ userPropertiesDto [ key ] . l = countlyPushNotification . helper . findUserPropertyLabelByValue ( userPropertiesDto [ key ] . k , userProperties ) ;
824
+ }
820
825
} ) ;
821
826
} ,
822
827
getUserPropertyElement : function ( index , userProperty ) {
841
846
isAdjacentIndex : function ( previousIndex , currentIndex ) {
842
847
return ( parseInt ( currentIndex ) - 1 ) === parseInt ( previousIndex ) ;
843
848
} ,
849
+ decodeHtml : function ( str ) {
850
+ var map =
851
+ {
852
+ '&' : '&' ,
853
+ '<' : '<' ,
854
+ '>' : '>' ,
855
+ '"' : '"' ,
856
+ ''' : "'" ,
857
+ ''' : "'"
858
+ } ;
859
+ return str . replace ( / & a m p ; | & l t ; | & g t ; | & q u o t ; | & # 0 3 9 ; | & # 3 9 ; / g, function ( m ) {
860
+ return map [ m ] ;
861
+ } ) ;
862
+ } ,
844
863
buildMessageText : function ( message , userPropertiesDto ) {
845
864
var self = this ;
846
865
if ( ! message ) {
849
868
if ( ! userPropertiesDto ) {
850
869
return message ;
851
870
}
852
- var messageInHTMLString = message ;
853
871
// var html = '',
854
872
// keys = this.sortUserProperties(userPropertiesDto),
855
873
// ranges = [-1]
878
896
// }
879
897
// });
880
898
// return html;
899
+ var messageInHTMLString = this . decodeHtml ( message ) ;
881
900
var buildMessageLength = 0 ;
882
901
var previousIndex = undefined ;
883
902
this . sortUserProperties ( userPropertiesDto ) . forEach ( function ( currentUserPropertyIndex , index ) {
You can’t perform that action at this time.
0 commit comments