twilio-chat
Advanced tools
Comparing version 0.13.0-dev-build.345 to 0.13.0-dev-build.346
@@ -240,13 +240,14 @@ "use strict"; | ||
case 3: | ||
log.trace('_subscribeStreams, this.entity.value=', this.entity.value); | ||
messagesObjectName = this.entity.value.messages; | ||
rosterObjectName = this.entity.value.roster; | ||
_context.next = 7; | ||
_context.next = 8; | ||
return _promise2.default.all([this.messagesEntity.subscribe(messagesObjectName), this.membersEntity.subscribe(rosterObjectName)]); | ||
case 7: | ||
_context.next = 13; | ||
case 8: | ||
_context.next = 14; | ||
break; | ||
case 9: | ||
_context.prev = 9; | ||
case 10: | ||
_context.prev = 10; | ||
_context.t0 = _context["catch"](0); | ||
@@ -257,3 +258,3 @@ | ||
case 13: | ||
case 14: | ||
case "end": | ||
@@ -263,3 +264,3 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[0, 9]]); | ||
}, _callee, this, [[0, 10]]); | ||
})); | ||
@@ -332,2 +333,3 @@ } | ||
value: function _update(update) { | ||
log.trace('_update', update); | ||
Channel.preprocessUpdate(update, this.sid); | ||
@@ -334,0 +336,0 @@ var updated = false; |
@@ -202,3 +202,2 @@ "use strict"; | ||
//public get connectionState(): string { this._connectionState; } | ||
/** | ||
@@ -205,0 +204,0 @@ * @returns {Promise.<T>|Request} |
@@ -298,5 +298,7 @@ "use strict"; | ||
log.trace('upsertChannel(sid=' + sid + ', data=', data); | ||
var channel = this.channels.get(sid); | ||
// Update the Channel's status if we know about it | ||
if (channel) { | ||
log.trace('upsertChannel: known channel', channel); | ||
if (data.status === 'joined' && channel.status !== 'joined') { | ||
@@ -331,2 +333,3 @@ channel._setStatus('joined'); | ||
// Fetch the Channel if we don't know about it | ||
log.trace('upsertChannel: unknown channel'); | ||
channel = new channel_1.Channel(this.services, data, sid); | ||
@@ -333,0 +336,0 @@ this.registerForEvents(channel); |
@@ -243,6 +243,3 @@ /// <reference types="node" /> | ||
type Type = 'public' | 'private'; | ||
type Status = 'known' | 'invited' | 'joined' | 'failed'; | ||
} | ||
/** 'public' | This channel is Public. */ | ||
/** 'private' | This channel is Private. */ | ||
/** | ||
@@ -253,6 +250,5 @@ * The status of the Channel, relative to the Client. | ||
*/ | ||
/** 'known' | This Client knows about the Channel, but the User is neither joined nor invited to it. */ | ||
/** 'invited' | This Client's User is invited to the Channel. */ | ||
/** 'joined' | This Client's User is joined to the Channel. */ | ||
/** 'failed' | This Channel is malformed, or has failed to load. */ | ||
declare namespace Channel { | ||
type Status = 'known' | 'invited' | 'joined' | 'failed'; | ||
} | ||
/** | ||
@@ -259,0 +255,0 @@ * Fired when a Member has joined the Channel. |
@@ -163,2 +163,3 @@ "use strict"; | ||
yield this._subscribe(); | ||
log.trace('_subscribeStreams, this.entity.value=', this.entity.value); | ||
const messagesObjectName = this.entity.value.messages; | ||
@@ -251,2 +252,3 @@ const rosterObjectName = this.entity.value.roster; | ||
_update(update) { | ||
log.trace('_update', update); | ||
Channel.preprocessUpdate(update, this.sid); | ||
@@ -253,0 +255,0 @@ let updated = false; |
@@ -145,3 +145,2 @@ "use strict"; | ||
get reachabilityEnabled() { return this.session.reachabilityEnabled; } | ||
//public get connectionState(): string { this._connectionState; } | ||
/** | ||
@@ -148,0 +147,0 @@ * @returns {Promise.<T>|Request} |
@@ -152,5 +152,7 @@ "use strict"; | ||
upsertChannel(sid, data) { | ||
log.trace('upsertChannel(sid=' + sid + ', data=', data); | ||
let channel = this.channels.get(sid); | ||
// Update the Channel's status if we know about it | ||
if (channel) { | ||
log.trace('upsertChannel: known channel', channel); | ||
if (data.status === 'joined' && channel.status !== 'joined') { | ||
@@ -182,2 +184,3 @@ channel._setStatus('joined'); | ||
// Fetch the Channel if we don't know about it | ||
log.trace('upsertChannel: unknown channel'); | ||
channel = new channel_1.Channel(this.services, data, sid); | ||
@@ -184,0 +187,0 @@ this.registerForEvents(channel); |
{ | ||
"name": "twilio-chat", | ||
"version": "0.13.0-dev-build.345", | ||
"version": "0.13.0-dev-build.346", | ||
"description": "Twilio Chat service client library", | ||
@@ -55,3 +55,3 @@ "main": "lib/index.js", | ||
"gulp-istanbul": "^1.1.1", | ||
"gulp-mocha": "^4.0.1", | ||
"gulp-mocha": "^4.1.0", | ||
"gulp-rename": "^1.2.2", | ||
@@ -58,0 +58,0 @@ "gulp-replace": "^0.5.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2010341
40082