@ -287,7 +287,7 @@ var MailTools = core.Class.extend({
return {
return {
is_starred : chat_manager . mail_tools . property_descr ( "channel_starred" , msg , chat_manager . mail_tools ) ,
is_starred : chat_manager . mail_tools . property_descr ( "channel_starred" , msg , chat_manager . mail_tools ) ,
is_needaction : chat_manager . mail_tools . property_descr ( "channel_inbox" , msg , chat_manager . mail_tools )
is_needaction : chat_manager . mail_tools . property_descr ( "channel_inbox" , msg , chat_manager . mail_tools )
}
} ;
} ,
} ,
set_channel_flags : function ( data , msg ) {
set_channel_flags : function ( data , msg ) {
@ -297,7 +297,7 @@ var MailTools = core.Class.extend({
if ( _ . contains ( data . starred_partner_ids , session . partner_id ) ) {
if ( _ . contains ( data . starred_partner_ids , session . partner_id ) ) {
msg . is_starred = true ;
msg . is_starred = true ;
}
}
return msg
return msg ;
} ,
} ,
get_channel_array : function ( msg ) {
get_channel_array : function ( msg ) {
@ -393,7 +393,7 @@ var MailTools = core.Class.extend({
} else {
} else {
channel = chat_manager . mail_tools . make_channel ( data , options ) ;
channel = chat_manager . mail_tools . make_channel ( data , options ) ;
channels . push ( channel ) ;
channels . push ( channel ) ;
channels = _ . sortBy ( channels , function ( channel ) { return _ . isString ( channel . name ) ? channel . name . toLowerCase ( ) : '' } ) ;
channels = _ . sortBy ( channels , function ( channel ) { return _ . isString ( channel . name ) ? channel . name . toLowerCase ( ) : '' ; } ) ;
if ( ! options . silent ) {
if ( ! options . silent ) {
chat_manager . bus . trigger ( "new_channel" , channel ) ;
chat_manager . bus . trigger ( "new_channel" , channel ) ;
}
}
@ -786,10 +786,10 @@ var cls = new MailTools();
chat_manager . mail_tools = cls ;
chat_manager . mail_tools = cls ;
// we add this function this way in order to make them extendable via MailTools.include({...})
// we add this function this way in order to make them extendable via MailTools.include({...})
chat_manager . make_message = function ( ) {
chat_manager . make_message = function ( ) {
return chat_manager . mail_tools . make_message . apply ( chat_manager . mail_tools , arguments )
return chat_manager . mail_tools . make_message . apply ( chat_manager . mail_tools , arguments ) ;
} ;
} ;
chat_manager . make_channel = function ( ) {
chat_manager . make_channel = function ( ) {
return chat_manager . mail_tools . make_channel . apply ( chat_manager . mail_tools , arguments )
return chat_manager . mail_tools . make_channel . apply ( chat_manager . mail_tools , arguments ) ;
} ;
} ;
chat_manager . post_message = function ( data , options ) {
chat_manager . post_message = function ( data , options ) {
options = options || { } ;
options = options || { } ;
@ -1120,7 +1120,7 @@ chat_manager.search_partner = function (search_val, limit) {
} ) ;
} ) ;
} ;
} ;
chat_manager . send_native_notification = function ( ) {
chat_manager . send_native_notification = function ( ) {
return chat_manager . mail_tools . send_native_notification . apply ( chat_manager . mail_tools , arguments )
return chat_manager . mail_tools . send_native_notification . apply ( chat_manager . mail_tools , arguments ) ;
} ;
} ;
chat_manager . bus . on ( 'client_action_open' , null , function ( open ) {
chat_manager . bus . on ( 'client_action_open' , null , function ( open ) {
client_action_open = open ;
client_action_open = open ;
@ -1162,7 +1162,7 @@ function init(){
// unsubscribe and then subscribe to the event, to avoid duplication of new messages
// unsubscribe and then subscribe to the event, to avoid duplication of new messages
bus . off ( 'notification' ) ;
bus . off ( 'notification' ) ;
bus . on ( 'notification' , null , function ( ) {
bus . on ( 'notification' , null , function ( ) {
chat_manager . mail_tools . on_notification . apply ( chat_manager . mail_tools , arguments )
chat_manager . mail_tools . on_notification . apply ( chat_manager . mail_tools , arguments ) ;
} ) ;
} ) ;
return $ . when ( load_menu_id , load_action_id , load_channels , load_emojis ) . then ( function ( menu_id , action_id ) {
return $ . when ( load_menu_id , load_action_id , load_channels , load_emojis ) . then ( function ( menu_id , action_id ) {