Skip to content

Instantly share code, notes, and snippets.

@Inviz
Created December 19, 2017 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Inviz/41daf0071736dd7da8a3d85f0746b4f9 to your computer and use it in GitHub Desktop.
Save Inviz/41daf0071736dd7da8a3d85f0746b4f9 to your computer and use it in GitHub Desktop.
var IncomingOrder = {
// NO, if channel_notification option is set `nothing`
'preference.channel_notification == "nothing"': function() {
this.set('result', false, 100)
},
// NO, if user is in dnd and message is not overriding it
'user_dnd && !message_dnd_override': function() {
this.set('result', false, 90)
},
// NO, if it's a muted @here message
'message_global && preference_mute_mentions': function() {
this.set('result', false, 80)
},
// NO, if notification settings is set to dms, and message isnt dm
'preference_channel_notification == "dms" && !message_private': function() {
this.set('result', false, 80)
},
// NO, if notification settings set to highlight words, and message doesnt have any
'preference_channel_notification == "highlights" && !message_higlights': function() {
this.set('result', false, 80)
},
// YES, if user subscribed to threaded message, and `threads_everything` is set
'message_thread && message_thread_subscription && preference_threads_everything': function() {
this.set('result', true, 70)
},
// NO, if channel is muted
'preference_channel_muted': function() {
this.set('result', false, 60)
},
// YES, if message is @mention
'message_mention': function() {
this.set('result', true, 20)
},
// YES, if its a comment for own file
'message_own_file_comment': function() {
this.set('result', true, 20)
},
// NO, if it's a @here message and user is not present
'message_global && channel_presence': function() {
this.set('result', false, 10)
},
// Yes, if message contains higlight word
'message_higlights': function() {
this.set('result', true, 0)
},
// NO, if message is threaded, user not subscribed
'message_thread && !message_thread_subscription': function() {
this.set('result', false, -10)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment