@ -44,42 +44,36 @@
return ;
return ;
}
}
var iconUrl = 'images/icon_128.png' ;
var title ;
var title = [
var message ;
var iconUrl ;
var newMessageCount = [
this . length ,
this . length ,
this . length === 1 ? i18n ( 'newMessage' ) : i18n ( 'newMessages' )
this . length === 1 ? i18n ( 'newMessage' ) : i18n ( 'newMessages' )
] . join ( ' ' ) ;
] . join ( ' ' ) ;
if ( setting === SETTINGS . COUNT ) {
var last = this . last ( ) ;
extension . notification . update ( {
switch ( this . getSetting ( ) ) {
type : 'basic' ,
case SETTINGS . COUNT :
title : title ,
title = 'Signal' ;
iconUrl : iconUrl
message = newMessageCount ;
} ) ;
break ;
return ;
case SETTINGS . NAME :
}
title = newMessageCount ;
message = 'Most recent from ' + last . get ( 'title' ) ;
var m = this . last ( ) ;
iconUrl = last . get ( 'iconUrl' ) ;
var type = 'basic' ;
break ;
var message = i18n ( 'newMessage' ) ;
case SETTINGS . MESSAGE :
var imageUrl ;
title = last . get ( 'title' ) ;
if ( this . showMessage ( ) ) {
message = last . get ( 'message' ) ;
message = m . get ( 'message' ) ;
iconUrl = last . get ( 'iconUrl' ) ;
if ( m . get ( 'imageUrl' ) ) {
break ;
type = 'image' ;
imageUrl = m . get ( 'imageUrl' ) ;
}
}
if ( this . showSender ( ) ) {
title = m . get ( 'title' ) ;
iconUrl = m . get ( 'iconUrl' ) ;
}
}
extension . notification . update ( {
extension . notification . update ( {
type : type ,
title : title ,
title : title ,
message : message ,
message : message ,
iconUrl : iconUrl ,
iconUrl : iconUrl
imageUrl : imageUrl
} ) ;
} ) ;
} ,
} ,
getSetting : function ( ) {
getSetting : function ( ) {