Remove set as alias setting (#16343)

pull/17141/head
Diego Sampaio 5 years ago committed by GitHub
parent 9fd381e824
commit e7362645ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/lib/server/lib/processDirectEmail.js
  2. 4
      app/lib/server/methods/sendMessage.js
  3. 5
      app/lib/server/startup/settings.js
  4. 1
      server/startup/migrations/index.js
  5. 21
      server/startup/migrations/v185.js

@ -102,10 +102,6 @@ export const processDirectEmail = function(email) {
}
}
if (message.alias == null && settings.get('Message_SetNameToAliasEnabled')) {
message.alias = user.name;
}
metrics.messagesSent.inc(); // TODO This line needs to be moved to it's proper place. See the comments on: https://github.com/RocketChat/Rocket.Chat/pull/5736
return _sendMessage(user, message, room);

@ -51,7 +51,6 @@ export function executeSendMessage(uid, message) {
fields: {
username: 1,
type: 1,
...!!settings.get('Message_SetNameToAliasEnabled') && { name: 1 },
},
});
let { rid } = message;
@ -69,9 +68,6 @@ export function executeSendMessage(uid, message) {
try {
const room = canSendMessage(rid, { uid, username: user.username, type: user.type });
if (message.alias == null && settings.get('Message_SetNameToAliasEnabled')) {
message.alias = user.name;
}
metrics.messagesSent.inc(); // TODO This line needs to be moved to it's proper place. See the comments on: https://github.com/RocketChat/Rocket.Chat/pull/5736
return sendMessage(user, message, room, false);

@ -1062,11 +1062,6 @@ settings.addGroup('Message', function() {
type: 'boolean',
public: true,
});
this.add('Message_SetNameToAliasEnabled', false, {
type: 'boolean',
public: false,
i18nDescription: 'Message_SetNameToAliasEnabled_Description',
});
this.add('Message_GroupingPeriod', 300, {
type: 'int',
public: true,

@ -182,4 +182,5 @@ import './v181';
import './v182';
import './v183';
import './v184';
import './v185';
import './xrun';

@ -0,0 +1,21 @@
import {
Migrations,
} from '../../../app/migrations/server';
import {
Settings,
} from '../../../app/models/server';
Migrations.add({
version: 185,
up() {
const setting = Settings.findOne({ _id: 'Message_SetNameToAliasEnabled' });
if (setting.value) {
Settings.update({ _id: 'UI_Use_Real_Name' }, {
$set: {
value: true,
},
});
}
Settings.remove({ _id: 'Message_SetNameToAliasEnabled' });
},
});
Loading…
Cancel
Save