Skip to content
Snippets Groups Projects
Unverified Commit e91d94f5 authored by graywolf336's avatar graywolf336
Browse files

Fix the generateEml throwing an error when the message type isn't defined and...

Fix the generateEml throwing an error when the message type isn't defined and fix a conflict of the saveSetting.coffee being added back in when it was removed
parent a8887741
No related branches found
No related tags found
No related merge requests found
Meteor.methods
saveSetting: (_id, value) ->
check _id, String
if Meteor.userId()?
user = Meteor.users.findOne Meteor.userId()
unless RocketChat.authz.hasPermission(Meteor.userId(), 'edit-privileged-setting') is true
throw new Meteor.Error 'error-action-not-allowed', 'Editing settings is not allowed', { method: 'saveSetting' }
# console.log "saveSetting -> ".green, _id, value
RocketChat.settings.updateById _id, value
return true
......@@ -58,7 +58,12 @@ RocketChat.smarsh.generateEml = () => {
data.msgs++;
if (message.t) {
const messageType = RocketChat.MessageTypes.getType(message);
rows.push(TAPi18n.__(messageType.message, messageType.data(message), 'en'));
if (messageType) {
rows.push(TAPi18n.__(messageType.message, messageType.data(message), 'en'));
} else {
console.log(`The message type ${message.t} does not have a MessageType.`);
rows.push(message.msg);
}
} else if (message.file) {
data.files.push(message.file._id);
rows.push(`${message.attachments[0].title} (${_getLink(message.attachments[0])})`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment