Built motion from commit 5ae821c.|0.0.127
[motion.git] / server / models / mail_account.js
index b3c5af3..21948a8 100644 (file)
@@ -2,6 +2,8 @@
  * Chat Website Model
  */
 
+var _ = require('lodash');
+
 module.exports = function(sequelize, DataTypes) {
 
        var MailAccount = sequelize.define('MailAccount', {
@@ -17,7 +19,7 @@ module.exports = function(sequelize, DataTypes) {
                                if (address) {
                                        this.setDataValue('address', address.toLowerCase());
                                }
-                       },
+                       }
                },
                fidelity: {
                        type: DataTypes.BOOLEAN,
@@ -50,6 +52,14 @@ module.exports = function(sequelize, DataTypes) {
                        set: function(val) {
                                return this.setDataValue('actions', JSON.stringify(val));
                        }
+               },
+               signature: {
+                       type: DataTypes.BLOB,
+                       get: function() {
+                               if (this.getDataValue('signature')) {
+                                       return _.toString(this.getDataValue('signature'));
+                               }
+                       }
                }
        }, {
                tableName: 'mail_accounts',