Skip to content

Commit bc09c82

Browse files
committed
Fixed issue #32
1 parent 5da37e6 commit bc09c82

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/status.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
return null;
6767
return AV.Object.createWithoutData('_Status', this.id);
6868
},
69+
_getDataJSON: function() {
70+
var json = AV._.clone(this.data);
71+
return AV._encode(json);
72+
},
6973
/**
7074
* Send a status by a AV.Query object.
7175
* <p>For example,send a status to male users:<br/><pre>
@@ -101,7 +105,7 @@
101105
this.data = this.data || {};
102106
var currUser = AV.Object.createWithoutData('_User', AV.User.current().id)._toPointer();
103107
this.data.source = this.data.source || currUser;
104-
data.data = this.data;
108+
data.data = this._getDataJSON();
105109
data.inboxType = this.inboxType || 'default';
106110

107111
var request = AV._request('statuses', null, null, 'POST', data);
@@ -158,7 +162,7 @@
158162
data.query = query;
159163
status.data = status.data || {};
160164
status.data.source = status.data.source || currUser;
161-
data.data = status.data;
165+
data.data = status._getDataJSON();
162166
data.inboxType = status.inboxType || 'default';
163167

164168
var request = AV._request('statuses', null, null, 'POST', data);
@@ -210,7 +214,7 @@
210214
data.query = query;
211215
status.data = status.data || {};
212216
status.data.source = status.data.source || currUser;
213-
data.data = status.data;
217+
data.data = status._getDataJSON();
214218
data.inboxType = 'private';
215219
status.inboxType = 'private';
216220

0 commit comments

Comments
 (0)