[IMP] mail: sidebar autocomplete: redirect to already opened DM
Before this rev., if the user clicked, in the autocomplete dropdown, on an already opened DM, nothing happened. Now, it redirects to that DM. Also clear the input once a partner is selected.
This commit is contained in:
@@ -339,7 +339,15 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
|
||||
},
|
||||
select: function(event, ui) {
|
||||
var partner_id = ui.item.id;
|
||||
chat_manager.create_channel(partner_id, "dm");
|
||||
var dm = chat_manager.get_dm_from_partner_id(partner_id);
|
||||
if (dm) {
|
||||
self.set_channel(dm);
|
||||
} else {
|
||||
chat_manager.create_channel(partner_id, "dm");
|
||||
}
|
||||
// clear the input
|
||||
$(this).val('');
|
||||
return false;
|
||||
},
|
||||
focus: function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user