Validate conversation type
This commit is contained in:
parent
5e3ed1658b
commit
fc3a600e72
1 changed files with 4 additions and 0 deletions
|
@ -39,6 +39,10 @@
|
||||||
var missing = _.filter(required, function(attr) { return !attributes[attr]; });
|
var missing = _.filter(required, function(attr) { return !attributes[attr]; });
|
||||||
if (missing.length) { return "Conversation must have " + missing; }
|
if (missing.length) { return "Conversation must have " + missing; }
|
||||||
|
|
||||||
|
if (attributes.type !== 'private' && attributes.type !== 'group') {
|
||||||
|
return "Invalid conversation type: " + attributes.type;
|
||||||
|
}
|
||||||
|
|
||||||
// hack
|
// hack
|
||||||
if (this.get('type') === 'private') {
|
if (this.get('type') === 'private') {
|
||||||
this.id = libphonenumber.util.verifyNumber(this.id);
|
this.id = libphonenumber.util.verifyNumber(this.id);
|
||||||
|
|
Loading…
Reference in a new issue