diff --git a/message/amd/build/message_area_contacts.min.js b/message/amd/build/message_area_contacts.min.js
index 3c852e6a220..f8b921982b4 100644
--- a/message/amd/build/message_area_contacts.min.js
+++ b/message/amd/build/message_area_contacts.min.js
@@ -1 +1 @@
-define(["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events","core/str","core_message/message_area_events"],function(a,b,c,d,e,f,g){function h(a){this.messageArea=a,this._init()}var i={CONTACT:"[data-region='contact']",CONTACTICONBLOCKED:"[data-region='contact-icon-blocked']",CONTACTS:"[data-region='contacts'][data-region-content='contacts']",CONTACTSAREA:"[data-region='contacts-area']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",LASTMESSAGETEXT:"[data-region='last-message-text']",LASTMESSAGEUSER:"[data-region='last-message-user']",LOADINGICON:".loading-icon",MESSAGETEXT:"[data-region='message-text']",MESSAGINGAREA:"[data-region='messaging-area']",NOCONTACTS:"[data-region=no-contacts]",SEARCHBOX:"[data-region='search-box']",SEARCHRESULTSAREA:"[data-region='search-results-area']",SEARCHTEXTAREA:"[data-region='search-text-area']",SELECTEDVIEWCONVERSATION:"[data-action='view-contact-msg'].selected",SELECTEDVIEWPROFILE:"[data-action='view-contact-profile'].selected",SHOWMESSAGES:"[data-action='show-messages']",VIEWCONVERSATION:"[data-action='view-contact-msg']",VIEWPROFILE:"[data-action='view-contact-profile']"};return h.prototype._isDeleting=!1,h.prototype._isLoadingConversations=!1,h.prototype._isLoadingContacts=!1,h.prototype._numContactsDisplayed=0,h.prototype._numContactsToRetrieve=20,h.prototype._numConversationsDisplayed=0,h.prototype._numConversationsToRetrieve=20,h.prototype._messageLength=60,h.prototype.messageArea=null,h.prototype._init=function(){e.define(this.messageArea.node,[e.events.activate,e.events.down,e.events.up]),this.messageArea.onCustomEvent(g.MESSAGESEARCHCANCELED,this._viewConversations.bind(this)),this.messageArea.onCustomEvent(g.USERSSEARCHCANCELED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONDELETED,this._deleteConversation.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONSSELECTED,this._viewConversations.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESDELETED,this._updateLastMessage.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESENT,this._handleMessageSent.bind(this)),this.messageArea.onCustomEvent(g.CONTACTREMOVED,function(a,b){this._removeContact(i.CONTACTS,b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTADDED,function(a,b){this._addContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTBLOCKED,function(a,b){this._blockContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTUNBLOCKED,function(a,b){this._unblockContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CHOOSEMESSAGESTODELETE,this._startDeleting.bind(this)),this.messageArea.onCustomEvent(g.CANCELDELETEMESSAGES,this._stopDeleting.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.VIEWCONVERSATION,this._viewConversation.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.VIEWPROFILE,this._viewContact.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.SHOWMESSAGES,this._showMessagingArea.bind(this)),this.messageArea.onDelegateEvent(e.events.up,i.CONTACT,this._selectPreviousContact.bind(this)),this.messageArea.onDelegateEvent(e.events.down,i.CONTACT,this._selectNextContact.bind(this)),this.messageArea.onDelegateEvent(e.events.up,i.VIEWCONVERSATION,this._selectPreviousConversation.bind(this)),this.messageArea.onDelegateEvent(e.events.down,i.VIEWCONVERSATION,this._selectNextConversation.bind(this)),this.messageArea.onDelegateEvent("focus",i.SEARCHBOX,this._setSearching.bind(this)),this.messageArea.onDelegateEvent("blur",i.SEARCHBOX,this._clearSearching.bind(this)),e.define(this.messageArea.find(i.CONVERSATIONS),[e.events.scrollBottom]),e.define(this.messageArea.find(i.CONTACTS),[e.events.scrollBottom]),this.messageArea.onDelegateEvent(e.events.scrollBottom,i.CONVERSATIONS,this._loadConversations.bind(this)),this.messageArea.onDelegateEvent(e.events.scrollBottom,i.CONTACTS,this._loadContacts.bind(this)),this._numConversationsDisplayed=20},h.prototype._startDeleting=function(){this._isDeleting=!0,this.messageArea.find(i.CONTACTSAREA).addClass("editing")},h.prototype._stopDeleting=function(){this._isDeleting=!1,this.messageArea.find(i.CONTACTSAREA).removeClass("editing")},h.prototype._viewConversations=function(){0===this._numConversationsDisplayed&&this._loadConversations(),this.messageArea.find(i.CONTACTS).hide(),this.messageArea.find(i.CONVERSATIONS).show()},h.prototype._viewContacts=function(){0===this._numContactsDisplayed&&this._loadContacts(),this.messageArea.find(i.CONVERSATIONS).hide(),this.messageArea.find(i.CONTACTS).show()},h.prototype._handleMessageSent=function(a,b,c){this._viewConversations();var d=this._getUserNode(i.CONVERSATIONS,b);if(0===d.length){var e=this._getUserNode(i.CONTACTS,b);if(0===e.length&&(e=this._getUserNode(i.SEARCHRESULTSAREA,b)),0==e.length)return;d=e.clone(),d.attr("data-action","view-contact-msg"),this.messageArea.find(i.CONVERSATIONS+" "+i.NOCONTACTS).remove(),this._numConversationsDisplayed++}d.prependTo(this.messageArea.find(i.CONVERSATIONS)),this.messageArea.find(i.CONVERSATIONS).scrollTop(0),this._updateContactText(d,c,!0),this._setSelectedUser("[data-userid='"+b+"']")},h.prototype._loadConversations=function(){if(this._isDeleting)return!1;if(this._isLoadingConversations)return!1;this._isLoadingConversations=!0;var a=0;return c.render("core/loading",{}).then(function(a,b){return this._numConversationsDisplayed?c.appendNodeContents(this.messageArea.find(i.CONVERSATIONS),"
"+a+"
",b):c.replaceNodeContents(this.messageArea.find(i.CONVERSATIONS),""+a+"
",b),this._getItems("core_message_data_for_messagearea_conversations",this._numConversationsDisplayed,this._numConversationsToRetrieve)}.bind(this)).then(function(b){return a=b.contacts.length,b.isconversation=!0,c.render("core_message/message_area_contacts",b)}).then(function(b,d){this.messageArea.find(i.CONVERSATIONS+" "+i.LOADINGICON).remove(),a>0?(c.appendNodeContents(this.messageArea.find(i.CONVERSATIONS),b,d),this._numConversationsDisplayed+=this._numConversationsToRetrieve):this._numConversationsDisplayed||c.replaceNodeContents(this.messageArea.find(i.CONVERSATIONS),b,d),this._isLoadingConversations=!1}.bind(this)).fail(d.exception)},h.prototype._loadContacts=function(){if(this._isDeleting)return!1;if(this._isLoadingContacts)return!1;this._isLoadingContacts=!0;var a=0;return c.render("core/loading",{}).then(function(a,b){return this._numContactsDisplayed?c.appendNodeContents(this.messageArea.find(i.CONTACTS),""+a+"
",b):c.replaceNodeContents(this.messageArea.find(i.CONTACTS),""+a+"
",b),this._getItems("core_message_data_for_messagearea_contacts",this._numContactsDisplayed,this._numContactsToRetrieve)}.bind(this)).then(function(b){return a=b.contacts.length,b.isconversation=!1,c.render("core_message/message_area_contacts",b)}).then(function(b,d){this.messageArea.find(i.CONTACTS+" "+i.LOADINGICON).remove(),a>0?(c.appendNodeContents(this.messageArea.find(i.CONTACTS),b,d),this._numContactsDisplayed+=a):this._numContactsDisplayed||c.replaceNodeContents(this.messageArea.find(i.CONTACTS),b,d),this._isLoadingContacts=!1}.bind(this)).fail(d.exception)},h.prototype._viewConversation=function(b){this._isDeleting&&this.messageArea.trigger(g.CANCELDELETEMESSAGES,c);var c=a(b.currentTarget).data("userid"),d=a(b.currentTarget).data("messageid"),e="[data-userid='"+c+"']";d&&(e="[data-messageid='"+d+"']"),this._setSelectedUser(e),this.messageArea.trigger(g.CONVERSATIONSELECTED,c),this.messageArea.find(i.SELECTEDVIEWPROFILE).removeClass("selected"),this._showMessagingArea()},h.prototype._viewContact=function(b){if(!this._isDeleting){var c=a(b.currentTarget).data("userid");this._setSelectedUser("[data-userid='"+c+"']"),this.messageArea.trigger(g.CONTACTSELECTED,c),this.messageArea.find(i.SELECTEDVIEWCONVERSATION).removeClass("selected"),this._showMessagingArea()}},h.prototype._getItems=function(a,c,d){var e=b.call([{methodname:a,args:{userid:this.messageArea.getCurrentUserId(),limitfrom:c,limitnum:d}}]);return e[0]},h.prototype._deleteConversation=function(a,b){this._removeContact(i.CONVERSATIONS,b),this._numConversationsDisplayed--,this._hideMessagingArea(),this._stopDeleting()},h.prototype._updateLastMessage=function(a,b,c){if(c){var d=this._getUserNode(i.CONVERSATIONS,b),e=c.find(i.MESSAGETEXT).text().trim(),f=!1;c.data("useridto")==b&&(f=!0),this._updateContactText(d,e,f)}this._stopDeleting()},h.prototype._addContact=function(){this.messageArea.find(i.CONTACTS).empty(),this._numContactsDisplayed=0,this._loadContacts()},h.prototype._removeContact=function(a,b){this._getUserNode(a,b).remove(),this._numContactsDisplayed--},h.prototype._blockContact=function(a){var b=this._getUserNode(i.CONTACTS,a);b.find(i.CONTACTICONBLOCKED).removeClass("hidden"),b=this._getUserNode(i.CONVERSATIONS,a),b.find(i.CONTACTICONBLOCKED).removeClass("hidden"),b=this._getUserNode(i.SEARCHRESULTSAREA,a),b.find(i.CONTACTICONBLOCKED).removeClass("hidden")},h.prototype._unblockContact=function(a){var b=this._getUserNode(i.CONTACTS,a);b.find(i.CONTACTICONBLOCKED).addClass("hidden"),b=this._getUserNode(i.CONVERSATIONS,a),b.find(i.CONTACTICONBLOCKED).addClass("hidden"),b=this._getUserNode(i.SEARCHRESULTSAREA,a),b.find(i.CONTACTICONBLOCKED).addClass("hidden")},h.prototype._getUserNode=function(a,b){return this.messageArea.find(a+" "+i.CONTACT+"[data-userid='"+b+"']")},h.prototype._setSelectedUser=function(a){this.messageArea.find(i.CONTACT).removeClass("selected"),this.messageArea.find(i.CONTACT+a).addClass("selected")},h.prototype._getContactText=function(a){return a.length>this._messageLength&&(a=a.substr(0,this._messageLength-3),a+="..."),a},h.prototype._updateContactText=function(a,b,c){b=this._getContactText(b),c?f.get_string("you","message").done(function(b){a.find(i.LASTMESSAGEUSER).empty().append(b)}).always(function(){a.find(i.LASTMESSAGETEXT).empty().append(b)}):(a.find(i.LASTMESSAGEUSER).empty(),a.find(i.LASTMESSAGETEXT).empty().append(b))},h.prototype._selectNextContact=function(b,c){var d=a(b.target).closest(i.CONTACT),e=d.next();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectPreviousContact=function(b,c){var d=a(b.target).closest(i.CONTACT),e=d.prev();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectNextConversation=function(b,c){var d=a(b.target).closest(i.VIEWCONVERSATION),e=d.next();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectPreviousConversation=function(b,c){var d=a(b.target).closest(i.VIEWCONVERSATION),e=d.prev();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._setSearching=function(){a(i.SEARCHTEXTAREA).addClass("searching")},h.prototype._clearSearching=function(){a(i.SEARCHTEXTAREA).removeClass("searching")},h.prototype._showMessagingArea=function(){this.messageArea.find(i.MESSAGINGAREA).removeClass("hide-messages").addClass("show-messages")},h.prototype._hideMessagingArea=function(){this.messageArea.find(i.MESSAGINGAREA).removeClass("show-messages").addClass("hide-messages")},h});
\ No newline at end of file
+define(["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events","core/str","core_message/message_area_events"],function(a,b,c,d,e,f,g){function h(a){this.messageArea=a,this._init()}var i={CONTACT:"[data-region='contact']",CONTACTICONBLOCKED:"[data-region='contact-icon-blocked']",CONTACTS:"[data-region='contacts'][data-region-content='contacts']",CONTACTSAREA:"[data-region='contacts-area']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",LASTMESSAGETEXT:"[data-region='last-message-text']",LASTMESSAGEUSER:"[data-region='last-message-user']",LOADINGICON:".loading-icon",MESSAGETEXT:"[data-region='message-text']",MESSAGINGAREA:"[data-region='messaging-area']",NOCONTACTS:"[data-region=no-contacts]",SEARCHBOX:"[data-region='search-box']",SEARCHRESULTSAREA:"[data-region='search-results-area']",SEARCHTEXTAREA:"[data-region='search-text-area']",SELECTEDVIEWCONVERSATION:"[data-action='view-contact-msg'].selected",SELECTEDVIEWPROFILE:"[data-action='view-contact-profile'].selected",SHOWMESSAGES:"[data-action='show-messages']",VIEWCONVERSATION:"[data-action='view-contact-msg']",VIEWPROFILE:"[data-action='view-contact-profile']"};return h.prototype._isLoadingConversations=!1,h.prototype._isLoadingContacts=!1,h.prototype._numContactsDisplayed=0,h.prototype._numContactsToRetrieve=20,h.prototype._numConversationsDisplayed=0,h.prototype._numConversationsToRetrieve=20,h.prototype._messageLength=60,h.prototype.messageArea=null,h.prototype._init=function(){e.define(this.messageArea.node,[e.events.activate,e.events.down,e.events.up]),this.messageArea.onCustomEvent(g.MESSAGESEARCHCANCELED,this._viewConversations.bind(this)),this.messageArea.onCustomEvent(g.USERSSEARCHCANCELED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONDELETED,this._deleteConversation.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONSSELECTED,this._viewConversations.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESDELETED,this._updateLastMessage.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESENT,this._handleMessageSent.bind(this)),this.messageArea.onCustomEvent(g.CONTACTREMOVED,function(a,b){this._removeContact(i.CONTACTS,b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTADDED,function(a,b){this._addContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTBLOCKED,function(a,b){this._blockContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTUNBLOCKED,function(a,b){this._unblockContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CHOOSEMESSAGESTODELETE,this._startDeleting.bind(this)),this.messageArea.onCustomEvent(g.CANCELDELETEMESSAGES,this._stopDeleting.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.VIEWCONVERSATION,this._viewConversation.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.VIEWPROFILE,this._viewContact.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.SHOWMESSAGES,this._showMessagingArea.bind(this)),this.messageArea.onDelegateEvent(e.events.up,i.CONTACT,this._selectPreviousContact.bind(this)),this.messageArea.onDelegateEvent(e.events.down,i.CONTACT,this._selectNextContact.bind(this)),this.messageArea.onDelegateEvent(e.events.up,i.VIEWCONVERSATION,this._selectPreviousConversation.bind(this)),this.messageArea.onDelegateEvent(e.events.down,i.VIEWCONVERSATION,this._selectNextConversation.bind(this)),this.messageArea.onDelegateEvent("focus",i.SEARCHBOX,this._setSearching.bind(this)),this.messageArea.onDelegateEvent("blur",i.SEARCHBOX,this._clearSearching.bind(this)),e.define(this.messageArea.find(i.CONVERSATIONS),[e.events.scrollBottom]),e.define(this.messageArea.find(i.CONTACTS),[e.events.scrollBottom]),this.messageArea.onDelegateEvent(e.events.scrollBottom,i.CONVERSATIONS,this._loadConversations.bind(this)),this.messageArea.onDelegateEvent(e.events.scrollBottom,i.CONTACTS,this._loadContacts.bind(this)),this._numConversationsDisplayed=20},h.prototype._startDeleting=function(){this.messageArea.find(i.CONTACTSAREA).addClass("editing")},h.prototype._stopDeleting=function(){this.messageArea.find(i.CONTACTSAREA).removeClass("editing")},h.prototype._viewConversations=function(){0===this._numConversationsDisplayed&&this._loadConversations(),this.messageArea.find(i.CONTACTS).hide(),this.messageArea.find(i.CONVERSATIONS).show()},h.prototype._viewContacts=function(){0===this._numContactsDisplayed&&this._loadContacts(),this.messageArea.find(i.CONVERSATIONS).hide(),this.messageArea.find(i.CONTACTS).show()},h.prototype._handleMessageSent=function(a,b,c){this._viewConversations();var d=this._getUserNode(i.CONVERSATIONS,b);if(0===d.length){var e=this._getUserNode(i.CONTACTS,b);if(0===e.length&&(e=this._getUserNode(i.SEARCHRESULTSAREA,b)),0==e.length)return;d=e.clone(),d.attr("data-action","view-contact-msg"),this.messageArea.find(i.CONVERSATIONS+" "+i.NOCONTACTS).remove(),this._numConversationsDisplayed++}d.prependTo(this.messageArea.find(i.CONVERSATIONS)),this.messageArea.find(i.CONVERSATIONS).scrollTop(0),this._updateContactText(d,c,!0),this._setSelectedUser("[data-userid='"+b+"']")},h.prototype._loadConversations=function(){if(this._isLoadingConversations)return!1;this._isLoadingConversations=!0;var a=0;return c.render("core/loading",{}).then(function(a,b){return this._numConversationsDisplayed?c.appendNodeContents(this.messageArea.find(i.CONVERSATIONS),""+a+"
",b):c.replaceNodeContents(this.messageArea.find(i.CONVERSATIONS),""+a+"
",b),this._getItems("core_message_data_for_messagearea_conversations",this._numConversationsDisplayed,this._numConversationsToRetrieve)}.bind(this)).then(function(b){return a=b.contacts.length,b.isconversation=!0,c.render("core_message/message_area_contacts",b)}).then(function(b,d){this.messageArea.find(i.CONVERSATIONS+" "+i.LOADINGICON).remove(),a>0?(c.appendNodeContents(this.messageArea.find(i.CONVERSATIONS),b,d),this._numConversationsDisplayed+=this._numConversationsToRetrieve):this._numConversationsDisplayed||c.replaceNodeContents(this.messageArea.find(i.CONVERSATIONS),b,d),this._isLoadingConversations=!1}.bind(this)).fail(d.exception)},h.prototype._loadContacts=function(){if(this._isLoadingContacts)return!1;this._isLoadingContacts=!0;var a=0;return c.render("core/loading",{}).then(function(a,b){return this._numContactsDisplayed?c.appendNodeContents(this.messageArea.find(i.CONTACTS),""+a+"
",b):c.replaceNodeContents(this.messageArea.find(i.CONTACTS),""+a+"
",b),this._getItems("core_message_data_for_messagearea_contacts",this._numContactsDisplayed,this._numContactsToRetrieve)}.bind(this)).then(function(b){return a=b.contacts.length,b.isconversation=!1,c.render("core_message/message_area_contacts",b)}).then(function(b,d){this.messageArea.find(i.CONTACTS+" "+i.LOADINGICON).remove(),a>0?(c.appendNodeContents(this.messageArea.find(i.CONTACTS),b,d),this._numContactsDisplayed+=a):this._numContactsDisplayed||c.replaceNodeContents(this.messageArea.find(i.CONTACTS),b,d),this._isLoadingContacts=!1}.bind(this)).fail(d.exception)},h.prototype._viewConversation=function(b){this.messageArea.trigger(g.CANCELDELETEMESSAGES);var c=a(b.currentTarget).data("userid"),d=a(b.currentTarget).data("messageid"),e="[data-userid='"+c+"']";d&&(e="[data-messageid='"+d+"']"),this._setSelectedUser(e),this.messageArea.trigger(g.CONVERSATIONSELECTED,c),this.messageArea.find(i.SELECTEDVIEWPROFILE).removeClass("selected"),this._showMessagingArea()},h.prototype._viewContact=function(b){this.messageArea.trigger(g.CANCELDELETEMESSAGES);var c=a(b.currentTarget).data("userid");this._setSelectedUser("[data-userid='"+c+"']"),this.messageArea.trigger(g.CONTACTSELECTED,c),this.messageArea.find(i.SELECTEDVIEWCONVERSATION).removeClass("selected"),this._showMessagingArea()},h.prototype._getItems=function(a,c,d){var e=b.call([{methodname:a,args:{userid:this.messageArea.getCurrentUserId(),limitfrom:c,limitnum:d}}]);return e[0]},h.prototype._deleteConversation=function(a,b){this._removeContact(i.CONVERSATIONS,b),this._numConversationsDisplayed--,this._hideMessagingArea(),this._stopDeleting()},h.prototype._updateLastMessage=function(a,b,c){if(c){var d=this._getUserNode(i.CONVERSATIONS,b),e=c.find(i.MESSAGETEXT).text().trim(),f=!1;c.data("useridto")==b&&(f=!0),this._updateContactText(d,e,f)}this._stopDeleting()},h.prototype._addContact=function(){this.messageArea.find(i.CONTACTS).empty(),this._numContactsDisplayed=0,this._loadContacts()},h.prototype._removeContact=function(a,b){this._getUserNode(a,b).remove(),this._numContactsDisplayed--},h.prototype._blockContact=function(a){var b=this._getUserNode(i.CONTACTS,a);b.find(i.CONTACTICONBLOCKED).removeClass("hidden"),b=this._getUserNode(i.CONVERSATIONS,a),b.find(i.CONTACTICONBLOCKED).removeClass("hidden"),b=this._getUserNode(i.SEARCHRESULTSAREA,a),b.find(i.CONTACTICONBLOCKED).removeClass("hidden")},h.prototype._unblockContact=function(a){var b=this._getUserNode(i.CONTACTS,a);b.find(i.CONTACTICONBLOCKED).addClass("hidden"),b=this._getUserNode(i.CONVERSATIONS,a),b.find(i.CONTACTICONBLOCKED).addClass("hidden"),b=this._getUserNode(i.SEARCHRESULTSAREA,a),b.find(i.CONTACTICONBLOCKED).addClass("hidden")},h.prototype._getUserNode=function(a,b){return this.messageArea.find(a+" "+i.CONTACT+"[data-userid='"+b+"']")},h.prototype._setSelectedUser=function(a){this.messageArea.find(i.CONTACT).removeClass("selected"),this.messageArea.find(i.CONTACT+a).addClass("selected")},h.prototype._getContactText=function(a){return a.length>this._messageLength&&(a=a.substr(0,this._messageLength-3),a+="..."),a},h.prototype._updateContactText=function(a,b,c){b=this._getContactText(b),c?f.get_string("you","message").done(function(b){a.find(i.LASTMESSAGEUSER).empty().append(b)}).always(function(){a.find(i.LASTMESSAGETEXT).empty().append(b)}):(a.find(i.LASTMESSAGEUSER).empty(),a.find(i.LASTMESSAGETEXT).empty().append(b))},h.prototype._selectNextContact=function(b,c){var d=a(b.target).closest(i.CONTACT),e=d.next();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectPreviousContact=function(b,c){var d=a(b.target).closest(i.CONTACT),e=d.prev();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectNextConversation=function(b,c){var d=a(b.target).closest(i.VIEWCONVERSATION),e=d.next();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectPreviousConversation=function(b,c){var d=a(b.target).closest(i.VIEWCONVERSATION),e=d.prev();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._setSearching=function(){a(i.SEARCHTEXTAREA).addClass("searching")},h.prototype._clearSearching=function(){a(i.SEARCHTEXTAREA).removeClass("searching")},h.prototype._showMessagingArea=function(){this.messageArea.find(i.MESSAGINGAREA).removeClass("hide-messages").addClass("show-messages")},h.prototype._hideMessagingArea=function(){this.messageArea.find(i.MESSAGINGAREA).removeClass("show-messages").addClass("hide-messages")},h});
\ No newline at end of file
diff --git a/message/amd/build/message_area_search.min.js b/message/amd/build/message_area_search.min.js
index 4e6ba2ef756..0a7f3e412a5 100644
--- a/message/amd/build/message_area_search.min.js
+++ b/message/amd/build/message_area_search.min.js
@@ -1 +1 @@
-define(["jquery","core/ajax","core/templates","core/notification","core/str","core/custom_interaction_events","core_message/message_area_events"],function(a,b,c,d,e,f,g){function h(a){this.messageArea=a,this._init()}var i={CONTACTS:"[data-region='contacts'][data-region-content='contacts']",CONTACTSAREA:"[data-region='contacts-area']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",DELETESEARCHFILTER:"[data-action='search-filter-delete']",LOADINGICON:".loading-icon",SEARCHBOX:"[data-region='search-box']",SEARCHFILTER:"[data-region='search-filter']",SEARCHFILTERAREA:"[data-region='search-filter-area']",SEARCHRESULTSAREA:"[data-region='search-results-area']",SEARCHTEXTAREA:"[data-region='search-text-area']",SEARCHUSERSINCOURSE:"[data-action='search-users-in-course']"};return h.prototype.messageArea=null,h.prototype._searchArea=null,h.prototype._courseid=null,h.prototype._isLoading=!1,h.prototype._numMessagesDisplayed=0,h.prototype._numMessagesToRetrieve=20,h.prototype._numUsersDisplayed=0,h.prototype._numUsersToRetrieve=20,h.prototype._searchAreas={MESSAGES:"messages",USERS:"users",USERSINCOURSE:"usersincourse"},h.prototype._requestTimeout=null,h.prototype._init=function(){this.messageArea.find(i.SEARCHTEXTAREA).on("input",this._searchRequest.bind(this)),this.messageArea.onDelegateEvent("click",i.SEARCHUSERSINCOURSE,function(b){this._setFilter(a(b.currentTarget).html()),this._setPlaceholderText("searchforuser"),this._clearSearchArea(),this._searchArea=this._searchAreas.USERSINCOURSE,this._courseid=a(b.currentTarget).data("courseid"),this._searchUsersInCourse()}.bind(this)),this.messageArea.onDelegateEvent("click",i.DELETESEARCHFILTER,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.USERS,this._setPlaceholderText("searchforuserorcourse"),this.messageArea.trigger(g.USERSSEARCHCANCELED)}.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONSSELECTED,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.MESSAGES,this._setPlaceholderText("searchmessages")}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.USERS,this._setPlaceholderText("searchforuserorcourse")}.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESENT,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.MESSAGES,this._setPlaceholderText("searchmessages")}.bind(this)),this.messageArea.onCustomEvent(g.CHOOSEMESSAGESTODELETE,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.MESSAGES,this._setPlaceholderText("searchmessages"),this._disableSearching()}.bind(this)),this.messageArea.onCustomEvent(g.CANCELDELETEMESSAGES,function(){this._enableSearching()}.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONDELETED,function(){this._enableSearching()}.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESDELETED,function(){this._enableSearching()}.bind(this)),f.define(this.messageArea.find(i.SEARCHRESULTSAREA),[f.events.scrollBottom]),this.messageArea.onDelegateEvent(f.events.scrollBottom,i.SEARCHRESULTSAREA,function(){this._searchArea==this._searchAreas.MESSAGES?this._searchMessages():this._searchArea==this._searchAreas.USERSINCOURSE&&this._searchUsersInCourse()}.bind(this)),this._searchArea=this._searchAreas.MESSAGES},h.prototype._searchRequest=function(){var a=this.messageArea.find(i.SEARCHTEXTAREA+" input").val();return this._requestTimeout&&clearTimeout(this._requestTimeout),""===a.trim()?void(this._searchArea==this._searchAreas.MESSAGES?(this._hideSearchResults(),this.messageArea.trigger(g.MESSAGESEARCHCANCELED)):this._searchArea==this._searchAreas.USERS?(this._hideSearchResults(),this.messageArea.trigger(g.USERSSEARCHCANCELED)):this._searchArea==this._searchAreas.USERSINCOURSE&&(this._clearSearchArea(),this._searchUsersInCourse())):(this.messageArea.find(i.CONVERSATIONS).hide(),this.messageArea.find(i.CONTACTS).hide(),this.messageArea.find(i.SEARCHRESULTSAREA).show(),void(this._searchArea==this._searchAreas.MESSAGES?this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numMessagesDisplayed=0,this._searchMessages()}.bind(this),300):this._searchArea==this._searchAreas.USERSINCOURSE?this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numUsersDisplayed=0,this._searchUsersInCourse()}.bind(this),300):this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numUsersDisplayed=0,this._searchUsers()}.bind(this),300)))},h.prototype._searchMessages=function(){if(this._isLoading)return!1;var a=this.messageArea.find(i.SEARCHBOX).val();this._isLoading=!0;var e=b.call([{methodname:"core_message_data_for_messagearea_search_messages",args:{userid:this.messageArea.getCurrentUserId(),search:a,limitfrom:this._numMessagesDisplayed,limitnum:this._numMessagesToRetrieve}}]),f=0;return c.render("core/loading",{}).then(function(a,b){return c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),""+a+"
",b),e[0]}.bind(this)).then(function(a){return f=a.contacts.length,c.render("core_message/message_area_message_search_results",a)}).then(function(a,b){this.messageArea.find(i.SEARCHRESULTSAREA+" "+i.LOADINGICON).remove(),f>0?(c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._numMessagesDisplayed+=f):0==this._numMessagesDisplayed&&c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._isLoading=!1}.bind(this)).fail(d.exception)},h.prototype._searchUsers=function(){var a=this.messageArea.find(i.SEARCHBOX).val(),e=b.call([{methodname:"core_message_data_for_messagearea_search_users",args:{userid:this.messageArea.getCurrentUserId(),search:a,limitnum:this._numUsersToRetrieve}}]);return c.render("core/loading",{}).then(function(a,b){return c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),""+a+"
",b),e[0]}.bind(this)).then(function(a){return a.contacts.length>0&&(a.hascontacts=!0),a.courses.length>0&&(a.hascourses=!0),a.noncontacts.length>0&&(a.hasnoncontacts=!0),c.render("core_message/message_area_user_search_results",a)}).then(function(a,b){c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b)}.bind(this)).fail(d.exception)},h.prototype._searchUsersInCourse=function(){if(this._isLoading)return!1;var a=this.messageArea.find(i.SEARCHBOX).val();this._isLoading=!0;var e=b.call([{methodname:"core_message_data_for_messagearea_search_users_in_course",args:{userid:this.messageArea.getCurrentUserId(),courseid:this._courseid,search:a,limitfrom:this._numUsersDisplayed,limitnum:this._numUsersToRetrieve}}]),f=0;return c.render("core/loading",{}).then(function(a,b){return c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),""+a+"
",b),e[0]}.bind(this)).then(function(a){return f=a.contacts.length,f>0&&(a.hascontacts=!0),c.render("core_message/message_area_user_search_results",a)}).then(function(a,b){this.messageArea.find(i.SEARCHRESULTSAREA+" "+i.LOADINGICON).remove(),f>0?(c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._numUsersDisplayed+=f):0==this._numUsersDisplayed&&c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._isLoading=!1}.bind(this)).fail(d.exception)},h.prototype._setPlaceholderText=function(a){return e.get_string(a,"message").then(function(a){this.messageArea.find(i.SEARCHTEXTAREA+" input").attr("placeholder",a)}.bind(this))},h.prototype._setFilter=function(a){this.messageArea.find(i.SEARCHBOX).val(""),this.messageArea.find(i.CONTACTSAREA).addClass("searchfilter"),this.messageArea.find(i.SEARCHFILTERAREA).show(),this.messageArea.find(i.SEARCHFILTER).html(a)},h.prototype._clearFilters=function(){this.messageArea.find(i.CONTACTSAREA).removeClass("searchfilter"),this.messageArea.find(i.SEARCHFILTER).empty(),this.messageArea.find(i.SEARCHFILTERAREA).hide()},h.prototype._clearSearchArea=function(){this.messageArea.find(i.SEARCHRESULTSAREA).empty()},h.prototype._hideSearchResults=function(){this._clearFilters(),this.messageArea.find(i.SEARCHTEXTAREA+" input").val(""),this._clearSearchArea(),this.messageArea.find(i.SEARCHRESULTSAREA).hide()},h.prototype._disableSearching=function(){this.messageArea.find(i.SEARCHBOX).prop("disabled",!0),this._searchArea==this._searchAreas.MESSAGES?this.messageArea.trigger(g.MESSAGESEARCHCANCELED):this._searchArea==this._searchAreas.USERS&&this.messageArea.trigger(g.USERSSEARCHCANCELED)},h.prototype._enableSearching=function(){this.messageArea.find(i.SEARCHBOX).prop("disabled",!1)},h});
\ No newline at end of file
+define(["jquery","core/ajax","core/templates","core/notification","core/str","core/custom_interaction_events","core_message/message_area_events"],function(a,b,c,d,e,f,g){function h(a){this.messageArea=a,this._init()}var i={CONTACTS:"[data-region='contacts'][data-region-content='contacts']",CONTACTSAREA:"[data-region='contacts-area']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",DELETESEARCHFILTER:"[data-action='search-filter-delete']",LOADINGICON:".loading-icon",SEARCHBOX:"[data-region='search-box']",SEARCHFILTER:"[data-region='search-filter']",SEARCHFILTERAREA:"[data-region='search-filter-area']",SEARCHRESULTSAREA:"[data-region='search-results-area']",SEARCHTEXTAREA:"[data-region='search-text-area']",SEARCHUSERSINCOURSE:"[data-action='search-users-in-course']"};return h.prototype.messageArea=null,h.prototype._searchArea=null,h.prototype._courseid=null,h.prototype._isLoading=!1,h.prototype._numMessagesDisplayed=0,h.prototype._numMessagesToRetrieve=20,h.prototype._numUsersDisplayed=0,h.prototype._numUsersToRetrieve=20,h.prototype._searchAreas={MESSAGES:"messages",USERS:"users",USERSINCOURSE:"usersincourse"},h.prototype._requestTimeout=null,h.prototype._init=function(){this.messageArea.find(i.SEARCHTEXTAREA).on("input",this._searchRequest.bind(this)),this.messageArea.onDelegateEvent("click",i.SEARCHUSERSINCOURSE,function(b){this._setFilter(a(b.currentTarget).html()),this._setPlaceholderText("searchforuser"),this._clearSearchArea(),this._searchArea=this._searchAreas.USERSINCOURSE,this._courseid=a(b.currentTarget).data("courseid"),this._searchUsersInCourse()}.bind(this)),this.messageArea.onDelegateEvent("click",i.DELETESEARCHFILTER,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.USERS,this._setPlaceholderText("searchforuserorcourse"),this.messageArea.trigger(g.USERSSEARCHCANCELED)}.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONSSELECTED,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.MESSAGES,this._setPlaceholderText("searchmessages")}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.USERS,this._setPlaceholderText("searchforuserorcourse")}.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESENT,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.MESSAGES,this._setPlaceholderText("searchmessages")}.bind(this)),f.define(this.messageArea.find(i.SEARCHRESULTSAREA),[f.events.scrollBottom]),this.messageArea.onDelegateEvent(f.events.scrollBottom,i.SEARCHRESULTSAREA,function(){this._searchArea==this._searchAreas.MESSAGES?this._searchMessages():this._searchArea==this._searchAreas.USERSINCOURSE&&this._searchUsersInCourse()}.bind(this)),this._searchArea=this._searchAreas.MESSAGES},h.prototype._searchRequest=function(){var a=this.messageArea.find(i.SEARCHTEXTAREA+" input").val();return this._requestTimeout&&clearTimeout(this._requestTimeout),""===a.trim()?void(this._searchArea==this._searchAreas.MESSAGES?(this._hideSearchResults(),this.messageArea.trigger(g.MESSAGESEARCHCANCELED)):this._searchArea==this._searchAreas.USERS?(this._hideSearchResults(),this.messageArea.trigger(g.USERSSEARCHCANCELED)):this._searchArea==this._searchAreas.USERSINCOURSE&&(this._clearSearchArea(),this._searchUsersInCourse())):(this.messageArea.find(i.CONVERSATIONS).hide(),this.messageArea.find(i.CONTACTS).hide(),this.messageArea.find(i.SEARCHRESULTSAREA).show(),void(this._searchArea==this._searchAreas.MESSAGES?this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numMessagesDisplayed=0,this._searchMessages()}.bind(this),300):this._searchArea==this._searchAreas.USERSINCOURSE?this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numUsersDisplayed=0,this._searchUsersInCourse()}.bind(this),300):this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numUsersDisplayed=0,this._searchUsers()}.bind(this),300)))},h.prototype._searchMessages=function(){if(this._isLoading)return!1;var a=this.messageArea.find(i.SEARCHBOX).val();this._isLoading=!0;var e=b.call([{methodname:"core_message_data_for_messagearea_search_messages",args:{userid:this.messageArea.getCurrentUserId(),search:a,limitfrom:this._numMessagesDisplayed,limitnum:this._numMessagesToRetrieve}}]),f=0;return c.render("core/loading",{}).then(function(a,b){return c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),""+a+"
",b),e[0]}.bind(this)).then(function(a){return f=a.contacts.length,c.render("core_message/message_area_message_search_results",a)}).then(function(a,b){this.messageArea.find(i.SEARCHRESULTSAREA+" "+i.LOADINGICON).remove(),f>0?(c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._numMessagesDisplayed+=f):0==this._numMessagesDisplayed&&c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._isLoading=!1}.bind(this)).fail(d.exception)},h.prototype._searchUsers=function(){var a=this.messageArea.find(i.SEARCHBOX).val(),e=b.call([{methodname:"core_message_data_for_messagearea_search_users",args:{userid:this.messageArea.getCurrentUserId(),search:a,limitnum:this._numUsersToRetrieve}}]);return c.render("core/loading",{}).then(function(a,b){return c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),""+a+"
",b),e[0]}.bind(this)).then(function(a){return a.contacts.length>0&&(a.hascontacts=!0),a.courses.length>0&&(a.hascourses=!0),a.noncontacts.length>0&&(a.hasnoncontacts=!0),c.render("core_message/message_area_user_search_results",a)}).then(function(a,b){c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b)}.bind(this)).fail(d.exception)},h.prototype._searchUsersInCourse=function(){if(this._isLoading)return!1;var a=this.messageArea.find(i.SEARCHBOX).val();this._isLoading=!0;var e=b.call([{methodname:"core_message_data_for_messagearea_search_users_in_course",args:{userid:this.messageArea.getCurrentUserId(),courseid:this._courseid,search:a,limitfrom:this._numUsersDisplayed,limitnum:this._numUsersToRetrieve}}]),f=0;return c.render("core/loading",{}).then(function(a,b){return c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),""+a+"
",b),e[0]}.bind(this)).then(function(a){return f=a.contacts.length,f>0&&(a.hascontacts=!0),c.render("core_message/message_area_user_search_results",a)}).then(function(a,b){this.messageArea.find(i.SEARCHRESULTSAREA+" "+i.LOADINGICON).remove(),f>0?(c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._numUsersDisplayed+=f):0==this._numUsersDisplayed&&c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._isLoading=!1}.bind(this)).fail(d.exception)},h.prototype._setPlaceholderText=function(a){return e.get_string(a,"message").then(function(a){this.messageArea.find(i.SEARCHTEXTAREA+" input").attr("placeholder",a)}.bind(this))},h.prototype._setFilter=function(a){this.messageArea.find(i.SEARCHBOX).val(""),this.messageArea.find(i.CONTACTSAREA).addClass("searchfilter"),this.messageArea.find(i.SEARCHFILTERAREA).show(),this.messageArea.find(i.SEARCHFILTER).html(a)},h.prototype._clearFilters=function(){this.messageArea.find(i.CONTACTSAREA).removeClass("searchfilter"),this.messageArea.find(i.SEARCHFILTER).empty(),this.messageArea.find(i.SEARCHFILTERAREA).hide()},h.prototype._clearSearchArea=function(){this.messageArea.find(i.SEARCHRESULTSAREA).empty()},h.prototype._hideSearchResults=function(){this._clearFilters(),this.messageArea.find(i.SEARCHTEXTAREA+" input").val(""),this._clearSearchArea(),this.messageArea.find(i.SEARCHRESULTSAREA).hide()},h});
\ No newline at end of file
diff --git a/message/amd/build/message_area_tabs.min.js b/message/amd/build/message_area_tabs.min.js
index 0a9a236b35c..9c3daf335cb 100644
--- a/message/amd/build/message_area_tabs.min.js
+++ b/message/amd/build/message_area_tabs.min.js
@@ -1 +1 @@
-define(["core/custom_interaction_events","core_message/message_area_events"],function(a,b){function c(a){this.messageArea=a,this._init()}var d={ACTIVECONTACTSTAB:"[data-region='contacts-area'] [role='tab'][aria-selected='true']",CONTACTSPANELS:"[data-region='contacts']",VIEWCONTACTS:"[data-action='contacts-view']",VIEWCONVERSATIONS:"[data-action='conversations-view']"};return c.prototype._isDeleting=!1,c.prototype.messageArea=null,c.prototype._init=function(){a.define(this.messageArea.node,[a.events.activate,a.events.up,a.events.down,a.events.next,a.events.previous,a.events.ctrlPageUp,a.events.ctrlPageDown]),this.messageArea.onDelegateEvent(a.events.activate,d.VIEWCONVERSATIONS,this._viewConversations.bind(this)),this.messageArea.onDelegateEvent(a.events.activate,d.VIEWCONTACTS,this._viewContacts.bind(this)),this.messageArea.onDelegateEvent(a.events.up,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.down,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.next,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.previous,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.up,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.down,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.next,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.previous,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.ctrlPageUp,d.CONTACTSPANELS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.ctrlPageDown,d.CONTACTSPANELS,this._toggleTabs.bind(this)),this.messageArea.onCustomEvent(b.CHOOSEMESSAGESTODELETE,function(){this._isDeleting=!0}.bind(this)),this.messageArea.onCustomEvent(b.MESSAGESDELETED,function(){this._isDeleting=!1}.bind(this)),this.messageArea.onCustomEvent(b.CONVERSATIONDELETED,function(){this._isDeleting=!1}.bind(this)),this.messageArea.onCustomEvent(b.CANCELDELETEMESSAGES,function(){this._isDeleting=!1}.bind(this)),this.messageArea.onCustomEvent(b.MESSAGESENT,function(){this._selectTab(d.VIEWCONVERSATIONS,d.VIEWCONTACTS)}.bind(this))},c.prototype._viewConversations=function(){this._isDeleting||(this.messageArea.trigger(b.CONVERSATIONSSELECTED),this._selectTab(d.VIEWCONVERSATIONS,d.VIEWCONTACTS))},c.prototype._viewContacts=function(){this._isDeleting||(this.messageArea.trigger(b.CONTACTSSELECTED),this._selectTab(d.VIEWCONTACTS,d.VIEWCONVERSATIONS))},c.prototype._selectTab=function(a,b){b=this.messageArea.find(b),b.removeClass("selected"),b.attr("aria-selected","false"),b.attr("tabindex","-1"),a=this.messageArea.find(a),a.addClass("selected"),a.attr("aria-selected","true"),a.attr("tabindex","0")},c.prototype._toggleTabs=function(a,b){var c=this.messageArea.find(d.ACTIVECONTACTSTAB);c.is(d.VIEWCONVERSATIONS)?this._viewContacts():this._viewConversations(),this.messageArea.find(d.ACTIVECONTACTSTAB).focus(),a.preventDefault(),a.stopPropagation(),b.originalEvent.preventDefault(),b.originalEvent.stopPropagation()},c});
\ No newline at end of file
+define(["core/custom_interaction_events","core_message/message_area_events"],function(a,b){function c(a){this.messageArea=a,this._init()}var d={ACTIVECONTACTSTAB:"[data-region='contacts-area'] [role='tab'][aria-selected='true']",CONTACTSPANELS:"[data-region='contacts']",VIEWCONTACTS:"[data-action='contacts-view']",VIEWCONVERSATIONS:"[data-action='conversations-view']"};return c.prototype.messageArea=null,c.prototype._init=function(){a.define(this.messageArea.node,[a.events.activate,a.events.up,a.events.down,a.events.next,a.events.previous,a.events.ctrlPageUp,a.events.ctrlPageDown]),this.messageArea.onDelegateEvent(a.events.activate,d.VIEWCONVERSATIONS,this._viewConversations.bind(this)),this.messageArea.onDelegateEvent(a.events.activate,d.VIEWCONTACTS,this._viewContacts.bind(this)),this.messageArea.onDelegateEvent(a.events.up,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.down,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.next,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.previous,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.up,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.down,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.next,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.previous,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.ctrlPageUp,d.CONTACTSPANELS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.ctrlPageDown,d.CONTACTSPANELS,this._toggleTabs.bind(this)),this.messageArea.onCustomEvent(b.MESSAGESENT,function(){this._selectTab(d.VIEWCONVERSATIONS,d.VIEWCONTACTS)}.bind(this))},c.prototype._viewConversations=function(){this.messageArea.trigger(b.CONVERSATIONSSELECTED),this._selectTab(d.VIEWCONVERSATIONS,d.VIEWCONTACTS)},c.prototype._viewContacts=function(){this.messageArea.trigger(b.CONTACTSSELECTED),this._selectTab(d.VIEWCONTACTS,d.VIEWCONVERSATIONS)},c.prototype._selectTab=function(a,b){b=this.messageArea.find(b),b.removeClass("selected"),b.attr("aria-selected","false"),b.attr("tabindex","-1"),a=this.messageArea.find(a),a.addClass("selected"),a.attr("aria-selected","true"),a.attr("tabindex","0")},c.prototype._toggleTabs=function(a,b){var c=this.messageArea.find(d.ACTIVECONTACTSTAB);c.is(d.VIEWCONVERSATIONS)?this._viewContacts():this._viewConversations(),this.messageArea.find(d.ACTIVECONTACTSTAB).focus(),a.preventDefault(),a.stopPropagation(),b.originalEvent.preventDefault(),b.originalEvent.stopPropagation()},c});
\ No newline at end of file
diff --git a/message/amd/src/message_area_contacts.js b/message/amd/src/message_area_contacts.js
index a8b5f408448..0158a71b3c1 100644
--- a/message/amd/src/message_area_contacts.js
+++ b/message/amd/src/message_area_contacts.js
@@ -58,9 +58,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
this._init();
}
- /** @type {Boolean} checks if we are currently deleting */
- Contacts.prototype._isDeleting = false;
-
/** @type {Boolean} checks if we are currently loading conversations */
Contacts.prototype._isLoadingConversations = false;
@@ -163,7 +160,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* @private
*/
Contacts.prototype._startDeleting = function() {
- this._isDeleting = true;
this.messageArea.find(SELECTORS.CONTACTSAREA).addClass('editing');
};
@@ -173,7 +169,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* @private
*/
Contacts.prototype._stopDeleting = function() {
- this._isDeleting = false;
this.messageArea.find(SELECTORS.CONTACTSAREA).removeClass('editing');
};
@@ -258,10 +253,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* @private
*/
Contacts.prototype._loadConversations = function() {
- if (this._isDeleting) {
- return false;
- }
-
if (this._isLoadingConversations) {
return false;
}
@@ -313,10 +304,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* @private
*/
Contacts.prototype._loadContacts = function() {
- if (this._isDeleting) {
- return false;
- }
-
if (this._isLoadingContacts) {
return false;
}
@@ -367,9 +354,8 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* @private
*/
Contacts.prototype._viewConversation = function(event) {
- if (this._isDeleting) {
- this.messageArea.trigger(Events.CANCELDELETEMESSAGES, userid);
- }
+ // Cancel any deletion of messages we may have.
+ this.messageArea.trigger(Events.CANCELDELETEMESSAGES);
var userid = $(event.currentTarget).data('userid');
var messageid = $(event.currentTarget).data('messageid');
@@ -394,14 +380,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* @private
*/
Contacts.prototype._viewContact = function(event) {
- if (!this._isDeleting) {
- var userid = $(event.currentTarget).data('userid');
- this._setSelectedUser("[data-userid='" + userid + "']");
- this.messageArea.trigger(Events.CONTACTSELECTED, userid);
- // Don't highlight the conversation because the message region has changed.
- this.messageArea.find(SELECTORS.SELECTEDVIEWCONVERSATION).removeClass('selected');
- this._showMessagingArea();
- }
+ // Cancel any deletion of messages we may have.
+ this.messageArea.trigger(Events.CANCELDELETEMESSAGES);
+
+ var userid = $(event.currentTarget).data('userid');
+ this._setSelectedUser("[data-userid='" + userid + "']");
+ this.messageArea.trigger(Events.CONTACTSELECTED, userid);
+ // Don't highlight the conversation because the message region has changed.
+ this.messageArea.find(SELECTORS.SELECTEDVIEWCONVERSATION).removeClass('selected');
+ this._showMessagingArea();
};
/**
diff --git a/message/amd/src/message_area_search.js b/message/amd/src/message_area_search.js
index 0fe56cd9450..0ff1f9672aa 100644
--- a/message/amd/src/message_area_search.js
+++ b/message/amd/src/message_area_search.js
@@ -129,21 +129,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
this._searchArea = this._searchAreas.MESSAGES;
this._setPlaceholderText('searchmessages');
}.bind(this));
- this.messageArea.onCustomEvent(Events.CHOOSEMESSAGESTODELETE, function() {
- this._hideSearchResults();
- this._searchArea = this._searchAreas.MESSAGES;
- this._setPlaceholderText('searchmessages');
- this._disableSearching();
- }.bind(this));
- this.messageArea.onCustomEvent(Events.CANCELDELETEMESSAGES, function() {
- this._enableSearching();
- }.bind(this));
- this.messageArea.onCustomEvent(Events.CONVERSATIONDELETED, function() {
- this._enableSearching();
- }.bind(this));
- this.messageArea.onCustomEvent(Events.MESSAGESDELETED, function() {
- this._enableSearching();
- }.bind(this));
// Event listeners for scrolling through messages and users in courses.
CustomEvents.define(this.messageArea.find(SELECTORS.SEARCHRESULTSAREA), [
@@ -430,29 +415,5 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
this.messageArea.find(SELECTORS.SEARCHRESULTSAREA).hide();
};
- /**
- * Disable search.
- *
- * @private
- */
- Search.prototype._disableSearching = function() {
- this.messageArea.find(SELECTORS.SEARCHBOX).prop('disabled', true);
-
- if (this._searchArea == this._searchAreas.MESSAGES) {
- this.messageArea.trigger(Events.MESSAGESEARCHCANCELED);
- } else if (this._searchArea == this._searchAreas.USERS) {
- this.messageArea.trigger(Events.USERSSEARCHCANCELED);
- }
- };
-
- /**
- * Enable search.
- *
- * @private
- */
- Search.prototype._enableSearching = function() {
- this.messageArea.find(SELECTORS.SEARCHBOX).prop('disabled', false);
- };
-
return Search;
});
diff --git a/message/amd/src/message_area_tabs.js b/message/amd/src/message_area_tabs.js
index 91797e9343f..b0bcca8fffc 100644
--- a/message/amd/src/message_area_tabs.js
+++ b/message/amd/src/message_area_tabs.js
@@ -41,9 +41,6 @@ define(['core/custom_interaction_events', 'core_message/message_area_events'], f
this._init();
}
- /** @type {Boolean} checks if we are currently deleting */
- Tabs.prototype._isDeleting = false;
-
/** @type {Messagearea} The messaging area object. */
Tabs.prototype.messageArea = null;
@@ -92,18 +89,6 @@ define(['core/custom_interaction_events', 'core_message/message_area_events'], f
this.messageArea.onDelegateEvent(CustomEvents.events.ctrlPageDown, SELECTORS.CONTACTSPANELS,
this._toggleTabs.bind(this));
- this.messageArea.onCustomEvent(Events.CHOOSEMESSAGESTODELETE, function() {
- this._isDeleting = true;
- }.bind(this));
- this.messageArea.onCustomEvent(Events.MESSAGESDELETED, function() {
- this._isDeleting = false;
- }.bind(this));
- this.messageArea.onCustomEvent(Events.CONVERSATIONDELETED, function() {
- this._isDeleting = false;
- }.bind(this));
- this.messageArea.onCustomEvent(Events.CANCELDELETEMESSAGES, function() {
- this._isDeleting = false;
- }.bind(this));
this.messageArea.onCustomEvent(Events.MESSAGESENT, function() {
this._selectTab(SELECTORS.VIEWCONVERSATIONS, SELECTORS.VIEWCONTACTS);
}.bind(this));
@@ -115,10 +100,6 @@ define(['core/custom_interaction_events', 'core_message/message_area_events'], f
* @private
*/
Tabs.prototype._viewConversations = function() {
- if (this._isDeleting) {
- return;
- }
-
this.messageArea.trigger(Events.CONVERSATIONSSELECTED);
this._selectTab(SELECTORS.VIEWCONVERSATIONS, SELECTORS.VIEWCONTACTS);
};
@@ -129,10 +110,6 @@ define(['core/custom_interaction_events', 'core_message/message_area_events'], f
* @private
*/
Tabs.prototype._viewContacts = function() {
- if (this._isDeleting) {
- return;
- }
-
this.messageArea.trigger(Events.CONTACTSSELECTED);
this._selectTab(SELECTORS.VIEWCONTACTS, SELECTORS.VIEWCONVERSATIONS);
};