Skip to content

Commit

Permalink
Merge pull request #8066 from lindoelio/direct-message-yourself
Browse files Browse the repository at this point in the history
[NEW] Add settings for allow user direct messages to yourself
  • Loading branch information
rodrigok authored Oct 9, 2017
2 parents e68836c + 455483a commit fb880ac
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@
"Message_AllowDeleting": "Allow Message Deleting",
"Message_AllowDeleting_BlockDeleteInMinutes": "Block Message Deleting After (n) Minutes",
"Message_AllowDeleting_BlockDeleteInMinutes_Description": "Enter 0 to disable blocking.",
"Message_AllowDirectMessagesToYourself": "Allow user direct messages to yourself",
"Message_AllowEditing": "Allow Message Editing",
"Message_AllowEditing_BlockEditInMinutes": "Block Message Editing After (n) Minutes",
"Message_AllowEditing_BlockEditInMinutesDescription": "Enter 0 to disable blocking.",
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@
"Message_AllowDeleting": "Permitir la eliminación de mensajes",
"Message_AllowDeleting_BlockDeleteInMinutes": "Bloquear la Eliminación de Mensajes Despues de (n) Minutos",
"Message_AllowDeleting_BlockDeleteInMinutes_Description": "Introduzca 0 para desactivar el bloqueo.",
"Message_AllowDirectMessagesToYourself": "Permita mensajes directos del usuario a usted mismo",
"Message_AllowEditing": "Permitir la edición de mensajes",
"Message_AllowEditing_BlockEditInMinutes": "Bloquear la Edicion de Mensajes Despues de (n) Minutos",
"Message_AllowEditing_BlockEditInMinutesDescription": "Ingrese 0 para deshabilitar el bloqueo.",
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@
"Message_AllowDeleting": "Permitir Exclusão de Mensagem",
"Message_AllowDeleting_BlockDeleteInMinutes": "Bloquear exclusão de mensagens após (n) minutos",
"Message_AllowDeleting_BlockDeleteInMinutes_Description": "Digite 0 para desativar o bloqueio.",
"Message_AllowDirectMessagesToYourself": "Permitir mensagens diretas do usuário para si mesmo",
"Message_AllowEditing": "Permitir Edição de Mensagem",
"Message_AllowEditing_BlockEditInMinutes": "Bloquear edição de mensagens após (em minutos - 0 para desabilitar)",
"Message_AllowEditing_BlockEditInMinutesDescription": "Insira 0 para desabilitar o bloqueio.",
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/pt.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@
"Message_AllowDeleting": "Permitir Exclusão de Mensagem",
"Message_AllowDeleting_BlockDeleteInMinutes": "Bloquear exclusão de mensagens após (n) minutos",
"Message_AllowDeleting_BlockDeleteInMinutes_Description": "Digite 0 para desativar o bloqueio.",
"Message_AllowDirectMessagesToYourself": "Permitir mensagens diretas do usuário para si mesmo",
"Message_AllowEditing": "Permitir Edição de Mensagem",
"Message_AllowEditing_BlockEditInMinutes": "Bloquear edição de mensagens após (em minutos - 0 para desabilitar)",
"Message_AllowEditing_BlockEditInMinutesDescription": "Insira 0 para desabilitar o bloqueio.",
Expand Down
4 changes: 4 additions & 0 deletions packages/rocketchat-lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,10 @@ RocketChat.settings.addGroup('Message', function() {
type: 'boolean',
'public': true
});
this.add('Message_AllowDirectMessagesToYourself', true, {
type: 'boolean',
'public': true
});
this.add('Message_AlwaysSearchRegExp', false, {
type: 'boolean'
});
Expand Down
2 changes: 1 addition & 1 deletion server/methods/createDirectMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Meteor.methods({
});
}

if (me.username === username) {
if (RocketChat.settings.get('Message_AllowDirectMessagesToYourself') === false && me.username === username) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
method: 'createDirectMessage'
});
Expand Down

0 comments on commit fb880ac

Please sign in to comment.