@@ -541,7 +541,7 @@ I18n.scoped 'conversations', (I18n) ->
541541 $form .attr action : $selected_conversation .find (' a.details_link' ).attr (' add_url' )
542542
543543 reset_message_form ()
544- $form .find (' #user_note_info' ).showIf ( $selected_conversation ? . hasClass ( ' private ' ) ).find (' input' ).attr (' checked' , false )
544+ $form .find (' #user_note_info' ).hide ( ).find (' input' ).attr (' checked' , false )
545545 $form .show ().find (' :input:visible:first' ).focus ()
546546
547547 reset_message_form = ->
@@ -610,6 +610,13 @@ I18n.scoped 'conversations', (I18n) ->
610610 for user in data .participants when ! MessageInbox .user_cache [user .id ]? .avatar
611611 MessageInbox .user_cache [user .id ] = user
612612 user .html_name = html_name_for_user (user)
613+ $form .find (' #user_note_info' ).showIf (
614+ $c .hasClass (' private' ) and
615+ (user_id = $c .find (' .participant' ).first ().data (' id' )) and
616+ (user = MessageInbox .user_cache [user_id]) and
617+ can_add_notes_for (user)
618+ )
619+ inbox_resize ()
613620 $messages .show ()
614621 i = j = 0
615622 message = data .messages [0 ]
@@ -656,9 +663,10 @@ I18n.scoped 'conversations', (I18n) ->
656663 $ .htmlEscape (user .name ) + if shared_contexts .length then " <em>" + $ .htmlEscape (shared_contexts) + " </em>" else ' '
657664
658665 can_add_notes_for = (user ) ->
666+ return false unless MessageInbox .notes_enabled
659667 return true if user .can_add_notes
660668 for course_id, roles of user .common_courses
661- return true if ' StudentEnrollment' in roles and (MessageInbox .can_add_notes or MessageInbox .contexts .courses [course_id]? .can_add_notes )
669+ return true if ' StudentEnrollment' in roles and (MessageInbox .can_add_notes_for_account or MessageInbox .contexts .courses [course_id]? .can_add_notes )
662670 false
663671
664672 formatted_message = (message ) ->
@@ -1423,6 +1431,7 @@ I18n.scoped 'conversations', (I18n) ->
14231431 $form .find (' #group_conversation' ).attr (' checked' , true )
14241432 $form .find (' #group_conversation_info' ).hide ()
14251433 $form .find (' #user_note_info' ).showIf ((user = MessageInbox .user_cache [tokens[0 ]]) and can_add_notes_for (user))
1434+ inbox_resize ()
14261435
14271436 $ (window ).resize inbox_resize
14281437 setTimeout inbox_resize
0 commit comments