@dhyasama/totem-models 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/Message.js +14 -0
  2. package/package.json +1 -1
package/lib/Message.js CHANGED
@@ -35,6 +35,20 @@ module.exports = function(mongoose, config) {
35
35
 
36
36
  ///////////////////////////////////////
37
37
 
38
+ Message.virtual('messageDate').get(function () {
39
+
40
+ // A little helper to get the message date since
41
+ // the original message date isn't always contained
42
+ // in the email. In its absence, use created on.
43
+
44
+ var self = this;
45
+
46
+ return self.originalMessageDate || self.createdOn;
47
+
48
+ });
49
+
50
+ ///////////////////////////////////////
51
+
38
52
  Message.statics.addDocument = function(messageId, doc, cb) {
39
53
 
40
54
  Document.createForModel(doc, this, messageId, cb);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",